Hi I am creating one app in which i want to send data from mobile to server.but problem is data is reflected on website only when server is online/Up.when server is offline i got response 400 or 502 and so data is displayed on only mobile screen it is not reflected on server.so i want to create Sqlite database so when i take reading data is stored in database and want to upload data which is the server is become online.this jon i want to insert in sqlite.i am new in android so i dont have idea how to insert this json into sqlite.please anyone help me.thanks in advanced
JSONObject json = new JSONObject();
json.put("siteId", "");
if (wtConnected == true) {
json.put("patientId", 15);
json.put("deviceMACId", DeviceMac);
json.put("readingType", 1003);
json.put("deviceData", weight);
json.put("deviceType", "WeightScale");
} else if (bpConnected == true) {
json.put("patientId", 5);
json.put("deviceMACId", DeviceMac);
json.put("readingType", 1002);
json.put("deviceData", bpdata);
json.put("deviceType", "BPMonitor");
}
json.put("assetId", "");
json.put("geoLocationLatitude", "");
json.put("clientId", "");
json.put("timeStamp", System.currentTimeMillis());
json.put("deviceRawData", "");
json.put("geoLocationLongitude", "");
System.out.println("Json Is:" + json);