Parsing JSON response in Android

前端 未结 2 667
执笔经年
执笔经年 2021-01-03 02:57

I am writing a httpget request for android that queries the foursquare api for nearby event. The JSON responce I receive back is

{\"groups\": [
{
  \"type\"         


        
相关标签:
2条回答
  • 2021-01-03 03:36

    I believe placing this code inside your for-loop should do the trick:

    JSONObject venueObject = venues.getJSONObject(i);
    double geoLat = venueObject.getDouble("geolat");
    double geoLong = venueObject.getDouble("geolong");
    
    0 讨论(0)
  • 2021-01-03 03:54

    You can check here and pick a JSON library to use to get at those values.

    0 讨论(0)
提交回复
热议问题