johnsnow85 johnsnow85 - 1 month ago 7x
Android Question

Check a JSON data every x minutes

I have an application about live streamer on dailymotion platform. Dailymotion have a websdk (in json). I didn't know how use json in android. I want to know how do an action if dailymotion live is on or off. And i want we check json all x minutes.

The JSON :

Any suggestions please.


Basically, In android u will have to parse JSON response either manually or using some Third party library.

e.g. if you have JSON response like follows:

   "pageInfo": {
         "pageName": "abc",
         "pagePic": ""
    "posts": [
              "post_id": "123456789012_123456789012",
              "actor_id": "1234567890",
              "picOfPersonWhoPosted": "",
              "nameOfPersonWhoPosted": "Jane Doe",
              "message": "Sounds cool. Can't wait to see it!",
              "likesCount": "2",
              "comments": [],
              "timeOfPost": "1234567890"

Then you can parse the above response as follows: import org.json.*;

JSONObject obj = new JSONObject(" .... ");
String pageName = obj.getJSONObject("pageInfo").getString("pageName");

JSONArray arr = obj.getJSONArray("posts");
for (int i = 0; i < arr.length(); i++)
    String post_id = arr.getJSONObject(i).getString("post_id");

You can also parse the above response using GSON library or some other library.