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

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

how to get url, format and remaining separately

    
asked by anonymous 27.11.2015 / 18:57

1 answer

1

You can use this library

There would be something close to that:

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