Saturday 22 April 2017

retrieve json array sent by android socket to node.js

how can this json object be retrieved in node.js. i tried socket.io and express, the connection is established but can not retrieve json object in node to save in database.

   JSONArray locAry = new JSONArray();
                        locAry.put(lat);
                        locAry.put(lon);
                        JSONObject obj = new JSONObject();
                        obj.put("coords",locAry);
                        obj.put("name",userPref.getString("user_name",""));
                        obj.put("id", userPref.getString("id",""));
                        obj.put("status", "0");
                        obj.put("type",userPref.getString("type",""));
                        obj.put("isdevice","1");

                        Common.socket.emit("Create Data", obj );
                        Common.socket.disconnect();



via babco Oshnouei

No comments:

Post a Comment