w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Making node.js send datagram socket data in a timely manner
In case it helps anybody else, we resolved this by replacing calls to requestAnimationFrame to calls with a timeout of 1ms and requestAnimationFrame. That permitted other things (such as udp send/receive processing) to squeeze in on the thread in the 1ms dealy, without significantly impacting overall fps. ~~~ p.s. Using nw 8.5 I found that deferring requestAnimationFrame with setTimeout worked best, giving typical OSC roundtrip times of 2ms. Deferring with process.setTick gave OSC roundtrip times of around 20ms. Calling requestAnimationFrame directly caused the almost complete block of OSC messages. Using nw 12.1 there was no issue, and all three variants behaved almost exactly the same with typical roundtrip times of 2ms. We have been constrained to use nw 8.5 for some time as our

Categories : Javascript

Send and Receive data C# using network stream
Although it is not shown in your code, I'm guessing _serverClient is a TcpClient. In both methods, you get a network stream from the same _serverClient, so you're accessing the exact same network stream. And it seems you expect that when you write data to the network stream in SendData, you should be able to read that same data within ReceiveData, which is not correct. When you write data to a network stream, it is actually sent over the network -- it is not available to be read from the same network stream. You can only read data that you receive from the remote endpoint. In other words, unless you have a remote endpoint sending you back data, you won't have any DataAvailable to read. In ReceiveData, you should be getting the network stream from the server end, e.g. from a TcpClient

Categories : C#

Android send SMS through an app and keep it on phone
Sending and SMS through SMSManager will never add the text to the other texting app, you have 2 options 1) The "correct" android way using intents (this will take users out of the app) Intent sendSMS = new Intent(Intent.ACTION_VIEW); sendSMS.setType("vnd.android-dir/mms-sms"); sendSMS.putExtra("address", "5558675309"); sendSMS.putExtra("sms_body","Your message here"); startActivity(sendSMS); 2) The undocumented way that seems to work most of the time here (Your mileage may vary). // code shamelessly copied from link above Context context; //you should initialize it somewhere ... ContentValues values = new ContentValues(); values.put("address", number); values.put("body", message ); values.put("date", time ); context.getContentResolver().insert(Uri.parse("content://sms/sent"), values);

Categories : Android

How to send data from client to server using Rikulo stream
Since you're using POST, the JSON data will be in the HTTP request's body. You can retrieve it there. Rikulo Commons has a utility called readAsJson. You can utilize it as follows. import "package:rikulo_commons/convert.dart"; Future checkUsername(HttpConnect connect) { return readAsJson(connect.request).then((Map<String, String> data) { String username = data["user"]; //...doa... }); } Notice that reading request's body is asynchronous, so you have to return a Future instance to indicate when it is done.

Categories : Dart

Android send udp when phone sleep
If you are wanting to send data periodically while the phone is sleeping, start a thread. It will continue running when the app is sent to the background. Or better, create a service if your data is very important. Services have priority over threads. The phone will automatically select which network to use (ie. 3g/4g if available, network if not)

Categories : Java

NodeJS/ExpressJS send response of large amount of data in 1 stream
Node's http.request() returns data in chunks for streaming (would be nice if they explicitly state this). Thus it's necessary to write each chunk to the body of Express's response, listen for the end of the http request (which is not really documented), and then call response.end() to actually finish the response. var req = http.request(options, function(res) { res.on( 'data', function(chunk) { response.write(chunk); } ); res.on( 'end', function() { response.end(); } ); } ); req.on('error', function(error) { … }); req.end(); Where response is Express's response the the initial client request (curl or angular's ajax call).

Categories : Node Js

How to Send/receive string via bluetooth android to another android phone
If you are sending via Bluetooth, you need to make a UUID object and use it to open the socket connection. I used a thread to listen for in coming data. you will also need a function to open and close the bluetooth connection. void openBT() throws IOException { UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb"); //Standard //SerialPortService ID mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid); mmSocket.connect(); mmOutputStream = mmSocket.getOutputStream(); mmInputStream = mmSocket.getInputStream(); beginListenForData(); myLabel.setText("Bluetooth Opened"); } void beginListenForData() { final Handler handler = new Handler(); final byte delimiter = 10; //This is the ASCII code for a newline chara

Categories : Android

Simple way to send short messages between Android phone
You can use NSD to acheive this. Refer to the Link The Sample App is a simple Chat app .This will give you an idea.

Categories : Android

Connection loses on data-send. Server receives RST, ACK after handshake
I don't think it's related to your code, but I do have several questions: 1. What is the network speed between client and the server? Are there any packets lost for other applications? What's the size of the message sent from client? 2. How long is it between the RST received and the handshake finishes (server) or message sent (client)? 3. Do you know if there are any firewalls between the client and server? You also said it worked well on LAN. The China GFW often does so.

Categories : Sockets

Send a Jpeg file from an Android phone to server station via a local network
It all depends how you expect the image on server side ... There you can expect to receive the data as Post body (array of bytes) or multipart (pretty much as the other one). This is for Http. Some links for these: An Http Post example sending a byte-array. Here's how you can convert a Bitmap to a byte-array. Send the Bitmap through a multi-part Post request. A simple example here, here or here. Haven't looked too much into details on each one, but the implementation is straigh-forward. Sending through socket or ftp is all about opening a connection, get the output stream and send the converted byte-array on that stream ...

Categories : Android

how to make a call,send SMS and send email in android application
You may send sms either using SmsManager or by invoking Built-in SMS application 1. Sending SMS using SmsManager API SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage("", null, "< message body>", null, null); SmsManager require, SMS_SEND permission in your android mainfeast. 2. Sending SMS by invoking Built-in SMS application Intent sendIntent = new Intent(Intent.ACTION_VIEW); sendIntent.putExtra("sms_body", “"); sendIntent.setType("vnd.android-dir/mms-sms"); startActivity(sendIntent); 3. Sending Email String to = toEmail.getText().toString(); String subject = emailSubject.getText().toString(); String message = emailBody.getText().toString(); Intent email = new Intent(Intent.ACTION_SEND); email.putExtra(Intent.EXTRA_EMAIL, new String[] { to })

Categories : Android

ajax, json send data from one php file to another and then send the data back
You just need to name the keys correctly in the data string. The PHP script is expecting "p_one" and "p_two", not "one" and "two". var dataString = 'p_one='+first_var+'&p_two='+second_var; Also, you need .text(), not .val() to get the inner text: var one = $("#first_var").text();

Categories : Ajax

Send Push notifications to iOS/Android on closed WiFi nework (no internet connection)
E.g. an on premises push notification service that can be used to send a notification to a users phone based on an event that is triggered by our server? With respect to Android, the answer is "not really". Your options are: Implement your "push" mechanism in the form of some message queue, where the devices poll looking for messages every so often, or Use a WakeLock and WifiLock to keep the device (and WiFi) powered on constantly, then use something like MQTT for the push message Either of these will be bad for the battery, though the first one is more configurable in terms of power drain (e.g., if you only check for messages once per hour, it won't be bad). The reason why GCM can keep the power drain low is because of special hooks for mobile data connections within the OS and

Categories : Android

Android: Send .wav to SIP-Phone via RTP (G.711 PCMU) very noisy, crackling sound based on SipDroid/MjSIP
My suspicion is the packetizing. This RFC tells you how it is suppoed to be done: RFC 5391 Turned out that this helped a little bit, but not all the way. If someone can help and it works, please accept his answer rather than mine.

Categories : Java

Android send xml file doesn't send attachment
I've seen several exemples but still don't get why, when I'm editing the mail I see the .xml attached but when I receive ther's no attachment! First, third-party apps cannot read internal storage of your app. Second, that might not be the right path to internal storage of your app. Never hardcode paths. Your app will fail for secondary accounts and restricted profiles on Android 4.2 tablets, for example. Always use a method, like getFilesDir(), to get at your portion of internal storage. You will need to either copy your file to external storage, or better yet, use FileProvider to serve up your file from internal storage via a content:// Uri.

Categories : Android

Unable to send data multiple requests in a single connection — socket error
The connection was closed because you called conn.getresponse() and the server closed it. There isn't much that you can do about it from your side of the connection aside from passing a Connection: keep-alive header and hope that the server will comply. If you want to send another HTTP request, you have to start with conn.putrequest("POST", path) or something similar.

Categories : Python

How can I send http messages from android app( physical device) to my local server without using internet connection?
Assuming that your devices are on the same Network (connected to the same router) as your computer, you can expose your computer's web server (Apache, presumably?) and then point your app directly at the local network IP address that your computer has (usually something like 192.168.1.x). I have found that the least painless way to do this is to use MAMP or WAMP or LAMP depending on your OS, but of course I have no idea what your specific situation is, so that solution may in fact make things a lot more complicated rather than less. In any event... your computer is on the network at a specific IP address, so it's just a matter of making sure that it's willing to serve this data on whatever port you are looking for it on. If you provide more specification as to your circumstances, we can

Categories : Android

Find app on computer and send to phone via phone number
You would need to implement something like twilio on your website. They provide an API that you can use to send text messages. It looks as though pricing starts at around 1 cent per message. They provide libraries in a variety of languages to help you get started.

Categories : Android

Best way to send data from PC to Android
You could use Python to send your data from the computer to a web server using POST: import urllib2, urllib mydata = [('one','1')] #The first is the var name the second is the value mydata = urllib.urlencode(mydata) path = 'http://localhost/new.php' #The URL you want to POST to req = urllib2.Request(path, mydata) req.add_header("Content-type", "application/x-www-form-urlencoded") page = urllib2.urlopen(req).read() print page Write them to a file on the server using PHP: <?php $file = "path/to/file/here" ; file_put_contents($file, $_POST['one'], FILE_APPEND | LOCK_EX); ?> Now develop your Android app which reads the values from the file. Use append or whatever if you need to save all the data or if you want data to be replaced. Otherwise, you could just use a Blue

Categories : Android

I know how to send information from Form1 to Form2, but how do I edit it and send it back if the data is contained in a List in Form1?
When you make new Form1() inside Form2, you are creating a completely new Form1 with no filled data. It's not the original Form1 that called Form2. So, what you need is to set that Form1 to the original, not to a new one: public partial class Form2 : Form { public Form2() { InitializeComponent(); } public Form1 fm1; //just declare, but let Form1 do the assign job. //the rest of the code... } And in Form 1 for (int i = c; i <= 0; i++) { if (lstCart.GetSelected(i)) { Form2 fm2 = new Form2(); fm2.productNameTextBox.Text = myBasket[i].ProductName; fm2.quantityTextBox.Text = Convert.ToString(myBasket[i].Quantity); fm2.latestPriceTextBox.Text = Convert.ToString(myBasket[i].LatestPrice); //here is the news:

Categories : C#

Send data from android to web api service
You are sending the request body as application/x-www-form-urlencoded but setting content type as JSON. Instead of using; `httpPost.setHeader("Content-Type", "application/json");` use; `httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");`

Categories : Javascript

Read/send data in android and c# Bluetooth Communication : c# <-> Android
To establish communication between two devices by using Web services you don't have to use winform application. You can establish a connection via web services, just create a new ASP.NET project using visual studio then add a Web service and folloe the template it gives you. Right click on the service, click on view in browser, verify there is no any error. The address of this browser is the address of your service just connect to this service from the second device. Please check out this guideline: CodeProject Web Service

Categories : C#

How to send processed data from asp.net web page to Android
I would use a WebView to navigate to the web site, passing the correct fileds in the URL string, and then interpret the resulting page of the website. Have a look at the official page of WebView: http://developer.android.com/reference/android/webkit/WebView.html And try to access the HTML of the page: http://lexandera.com/2009/01/extracting-html-from-a-webview/ So you can read the resulting HTML and get whatever you want form it. I suggest you to create a lightweight web page of your site specifically for be interpreted by your App. Now, passing username/password in the URL address is never good. If you don't use SSL a Man in the middle attack is always a potential security problem (http://en.wikipedia.org/wiki/Man-in-the-middle_attack)

Categories : Android

Send data to database on click android
on First activity insert data to data base when its inserted start next activity your insertData function of database class, should return long type data like long success = db.insert(tableName, null, values); return success; than inside First Activity if(longReturned>0) { //startActivity2 here }

Categories : Android

how to send data from website server to android app
A better but more complex way to do it is to use Google Cloud Messaging (aka Push Notifications). This way your server can notify the app that there are new data to be retrieved, and only then your app has to query your server. This is a much more battery friendly approach and works pretty well. I've used this before for the same reason. To answer some of the comments too, polling is a bad idea because it overuses both your server and the user's device for no reason it will drain the user's battery there will always be some delay between when the server wants to communicate with the app and the time your app will do the next polling. The push notification approach takes more effort but has great advantages too.

Categories : Android

Android Send Post Data To Server
Try using the below code inside your mainactivityactivity below setContentView() to avoid networkOnmainThread exception.. if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } But, doing heavy operation inside background thread using AsyncTask without blocking main thread would be great! And also refer this link... AsyncTask Android example

Categories : Android

How to Send data from Android app to a Server date?
You are calling postData(); in onCreate. You haven't received any position at this point. You have to move postData(); to when you actually receive a Location, i.e. in onLocationChanged. You'll also probably need to put that in an AsyncTask.

Categories : Android

send and receive data to web service through Android
The way it works is that you have to upload your web services on a server. Try 000webhost.com Than you can use the URL of the web service to connect/send data/recieve data from the web service http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ this might help you

Categories : Android

Android doesn`t send data on first buttonpress
I found the problem in my button listener: case 0: //Start button sends = 1; mSensorManager.registerListener(BluetoothChat.this, mAccelerometer, SensorManager.SENSOR_DELAY_UI); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); break; It only works after the first click because the mAcceleromter wasn`t initialized on the first click. To fix this, I just swapped those two lines. case 0: //Start button sends = 1; mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mSensorManager.registerListener(BluetoothChat.this, mAccelerometer, SensorManager.SENSOR_DELAY_UI); break; Now it works on the first button press.

Categories : Android

send data from android app to cakephp whith url
Except you're running a webserver and CakePHP on your phone you might want to use the ip or hostname of the machine running the website instead of using localhost from your phone. localhost/ar/users/login?name=m_sepehri&password=111 And read this page about json views in CakePHP. Also sending the password in plain text and as a bonus not using https is negligent.

Categories : Java

Android: Rest PUT - how send data on server
Well this is too complex to handle it yourself, take a look at this library with much cleaner API and type-safe data. https://github.com/kodart/Httpzoid Here is a simple usage example Http http = HttpFactory.create(context); http.post("http://example.com/users") .data(new User("John")) .execute(); Or more complex with callbacks Http http = HttpFactory.create(context); http.post("http://example.com/users") .data(new User("John")) .handler(new ResponseHandler<Void>() { @Override public void success(Void ignore, HttpResponse response) { } @Override public void error(String message, HttpResponse response) { } @Override public void failure(NetworkError error) { } @Override publ

Categories : Java

Android send data from android to the server as bundle
Not sure exactly what you want, but one solution is to use a JSONArray in addition to what you are currently doing. You would continue to create the JSONObjects exactly as you are, but instead of sending right away, add it to a JSONArray. Then on whatever iteration you want (say after you have added 100 JSONObjects), send the JSONArray to the server.

Categories : Android

How do I send an Image to a web services that takes Stream.IO from iOS?
To get your image in base64 on a NSString, you can do : NSData *imageData = UIImageJPEGRepresentation(image, 1.0); NSString *encodedString = [imageData base64Encoding]; After, you can send your request as a string. You can see an example here.

Categories : C#

How can I further compress a JPEG to send over a TCP Stream in C/C++ on Windows?
Either use a lower quality than 20, or or reduce the size of the image. Both will of course degrade the quality. But there aren't any obvious compression techniques that you can use on a JPEG compressed image - it's about as small as it will get (even high quality JPEG's will compress rather poorly, because JPEG does a good job at compressing the actual data in the image, as well as "destroying" pixels when compression levels are quite high). You can prove this by taking a number of JPEG images and compress them with your favourite compression program (ZIP, GZIP, BZIP, etc). You can also reduce the number of colours in the image - a 256 (8-bit) or 64K (16-bit) image will compress much better than a 16M (24/32-bit) image. Other obvious answer is to only send the DIFFERENCE between one f

Categories : C++

send stream from WCF service ready for printing
You should still be able to use GDI+ (Graphics class) in the server environment. If your only concern is the image size, consider using Metafile instead of bitmap, which is a pretty compact and resolution-independent format (you set the DPI).

Categories : C#

android. Send data from class to activity and get result
You can create OnClickListener class init it in activity and pass to the adapter. Set it to the buttons in your adapter. After click on a button his listener will fire and do whatever you want. If you need to pass some params simply override OnClickListener to get all the params you need. You can write onClickListener like this (example for ListActivity, so just change getListView to your ListView): private OnClickListener mEditClickListener = new OnClickListener() { @Override public void onClick(View v) { int position = getListView().getPositionForView(v); } }

Categories : Java

how to send data to other paticipant using intent or bundle in android
You can't do this with intents. To communicate between different phones you need to use something that can connect the devices together. This can be a web server, Bluetooth, a local wifi network but there has to be a connection between the different phones before you can do this.

Categories : Android

Android HID USB how to send hexadeсimal data with bulkTransfer or controlTransfer?
This depends on what the target of the message buffer will be. Since you are getting decimal values from a String you can use the Integer.parseInt method with a radix of 10, then cast to a byte: byte message[] = new byte[] { (byte)java.lang.Integer.parseInt("0", 10), (byte)java.lang.Integer.parseInt("166", 10), (byte)java.lang.Integer.parseInt("2", 10), (byte)java.lang.Integer.parseInt("252", 10), (byte)java.lang.Integer.parseInt("255", 10) }; If you simply want to send the data over the bulk pipe then you would send it as follows: bulkTransfer(outEndpoint, message, message.length, 1000); Control requests typically target some function on the USB device itself and is vendor defined. If you need to send the buffer as a control request y

Categories : Java

Send Base64 encoded data over USSD from Android
With Intent.ACTION_CALL your Base64 text will be converted to numeric A,B,C to 2, D,E,F to 3 and so on (default behaviour of OutgoingCallReceiver). So, no way to send text data by USSD in Android (at least with standard methods)...

Categories : Android

Unable to send JSON data from Android to ROR server
send your json object in BasicNameValuePair //here sear ,shortvalue are json DefaultHttpClient client1 = new DefaultHttpClient(); List<NameValuePair> params1 = new ArrayList<NameValuePair>(); params1.add(new BasicNameValuePair("q",sear)); params1.add(new BasicNameValuePair("o",shortvalue)); params1.add(new BasicNameValuePair("p","1")); params1.add(new BasicNameValuePair("filter_on",String.valueOf(jarry))); String paramString = URLEncodedUtils.format(params1, "utf-8"); HttpGet httpGet = new HttpGet(servername+"search/"+"?" + paramString); //httpGet.setHeader("Cookie","_bb_vid="+""+Vis_id12); try { httpResponse = c

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.