World Languages, asked by vajo, 5 months ago

how to connect website and android application to each other​

Answers

Answered by BlastOracle
9

 =  =  =  >

Write json files that you access on both the web and the Android app,

Use AsyncTask in android and access the url of your JSON to do the POST or GET with your data,

In the web, simply do the same, write a page that reads the json data that you return from the page you first created.

Android Example that reads data from a json file:

private void parseJsonFeed(JSONObject response) {

try {

Log.e("Log1", "entered feed json pass");

String result = response.toString();

JSONArray feedArray = response.getJSONArray("feed");

//JSONArray feedArray = new JSONArray(result); for (int i = 0; i < feedArray.length(); i++) {

JSONObject feedObj = (JSONObject) feedArray.get(i);

Similar questions