I creats one apps in android.I have fetch data from server side useing json but i have proble how to send json string or jso to server
Asked
Active
Viewed 1,089 times
2 Answers
0
You can create JsonObject, put data in it and then convert it toString() for sending. How to do sending itself depends on your server. Also, refer this question.
0
I will advice you to use a fast parser if your data is large. I use Jackson. And you can find related code. With Jackson you can use Object Mapper for default map conversion
ObjectMapper objectMapper = new ObjectMapper();
httppost.addData("points", getMapper().writeValueAsString(points));
InputStream instream = httpclient.execute(httppost).getEntity().getContent();
return getMapper().readValue(instream, HashMap.class);

Seray Uzgur
- 113
- 7