Android : Android Custom Canvas

on Friday, August 22, 2014


How to put this in json format.



{
"caller-id": "2434141414",
"map-id": "2",
"src": {
"x": "23",
"y": "34"
},
"dest": {
"x": "23",
"y": "34"
}
}


I tried like this :



JSONObject src = new JSONObject();
JSONObject dest = new JSONObject();
src.put("src", mObjUserPath.get("x1"));
src.put("src", mObjUserPath.get("y1"));
dest.put("dest", mObjUserPath.get("x2"));
dest.put("dest", mObjUserPath.get("y2"));
json.put("caller-id", Util.getDeviceID(this));
json.put("map-id", RestClientAsyncTask.mapId);
json.put("src", src);
json.put("dest", dest);


but is not in format what I expected.Please help Any help will be appreciated!


0 comments:

Post a Comment