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();
}
}
fi.foyt.foursquare.api.FoursquareApiException: org.json.JSONException: JSONObject["specials"] is not a JSONArray.