Sunday, March 2, 2014

Urgent! android how to send json data in real time, seeking advice, please everyone up


Will the great God who, android what way can be made in real time sending json data, is there any correlation demo, thank you
Time, task level, immediately to pay the code, I was a rookie, I hope you can help me, thank you<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
json just strings, using http, socket can be sent.

With JSONObject class can easily generate json string.
Reply:
Json string how should I send out?
Reply:
httpclient

Find the rest of the Mother
Reply:
Look where you want to send, and sent back to the server, then use HttpClient, HttpPost using post model, the client can send data to the server; If just all kinds of data transfer between that approach the more, there are many online

Reply:
There are many online Yuriko But if 4.0 or later going on to write in the thread
Reply:
Get hold of the Service,
So he sent every once a while,
Reply:
references, 5th Floor u012536244 reply:
There are many online Yuriko But if 4.0 or later would write in the thread


references, 4th Floor Kuai_jia_long reply:
see what you want to send, and sent back to the server, then use HttpClient, HttpPost using post mode, you can send the client to the server side data; If just all kinds of data transfer between that approach the more, there are many online

Http long connection should be how to write ah?
Reply:
Recommends using HttpClient, as relatively simple,
HttpClient client = new HttpClientDefault ();
HttpPost post = new HttpPost ();
Join in the post needs to send data
HttpResponse response = client.execute (post);
If the connection is successful, response.getEntity () is not null, and response.getEntity () return value is the response from the server
Reply:
Go to the next gson jar package

No comments:

Post a Comment