Skip to content
This repository was archived by the owner on Oct 14, 2023. It is now read-only.
This repository was archived by the owner on Oct 14, 2023. It is now read-only.

Venus Search Exception #10

Description

@Kml55

I am getting jsonexception on venus search. I call venus search like below

public static void venuesInTheBox(double currLat,double currLon){
         // First we need a initialize FoursquareApi. 
        FoursquareApi foursquareApi = new FoursquareApi("myclientid", "myclientsecret", "");
        SimpleDateFormat df = new SimpleDateFormat("YYYYMMDD");
        foursquareApi.setVersion(df.format(Calendar.getInstance().getTime()));
        // After client has been initialized we can make queries.
        Result<VenuesSearchResult> result;
        try {
            result = foursquareApi.venuesSearch(currLat+","+currLon, null, null, null, null, null, null, null, null, null, null);
            if (result.getMeta().getCode() == 200) {
                  // if query was ok we can finally we do something with the data
                  for (CompactVenue venue : result.getResult().getVenues()) {
                    // TODO: Do something we the data
                    System.out.println(venue.getName());
                  }
            }else{
                  // TODO: Proper error handling
                  System.out.println("Error occured: ");
                  System.out.println("  code: " + result.getMeta().getCode());
                  System.out.println("  type: " + result.getMeta().getErrorType());
                  System.out.println("  detail: " + result.getMeta().getErrorDetail()); 
            }
        }catch(FoursquareApiException e){
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

The exception is this

fi.foyt.foursquare.api.FoursquareApiException: org.json.JSONException: JSONObject["specials"] is not a JSONArray.

What should I do ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions