How to get the url for this Json (java android)

Asked

Viewed 141 times

1

{  
   "success":[  
      {  
         "url":"http:\/\/stream.vagalume.fm\/stream"
      }
   ],
   "format":"mp3",
   "remaining":0
}

how to get the url, format and remaining separately

1 answer

1

You can use that library

There’d be something close:

public String getTranslation(String json){  
  JSONObject data = new JSONObject(json);
  return data.getJSONArray("sucesso").getJSONObject(0).getString("url");
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.