Hi,
In the below code, I m trying to get places 1000 miles around me. I get 10 records. However I get over 30 records when I execute the same query in developer console.
What could be the possible reason ?
Thank you in advance.
private void InitPlacesAroundMe() {
String whereClause = “distance(” + Double.toString(mLastLocation.getLatitude()) + “,”
+ Double.toString(mLastLocation.getLongitude()) + ", "
+ “Coordinates.latitude, Coordinates.longitude) < mi(”
+ Integer.toString(distanceOfPlacesAroundMeInMiles) + “)”;
// Get places around you
BackendlessDataQuery dataQuery = new BackendlessDataQuery(whereClause);
QueryOptions queryOptions = new QueryOptions();
queryOptions.addRelated("Coordinates");
dataQuery.setQueryOptions(queryOptions);
Backendless.Data.of(LocationToArticleMapping.class).find(dataQuery,
new AsyncCallback<BackendlessCollection<LocationToArticleMapping>>() {
@Override
public void handleResponse(BackendlessCollection<LocationToArticleMapping> placeSearchResult) {
mPlacesAroundMe = placeSearchResult.getData();
Toast.makeText(getApplicationContext(), "InitPlacesAroundMe: " + "No. of places = "
+ placeSearchResult.getCurrentPage().size(), Toast.LENGTH_LONG).show();
}
@Override
public void handleFault(BackendlessFault backendlessFault) {
Toast.makeText(getApplicationContext(), "InitPlacesAroundMe: " + "Server reported an error - "
+ backendlessFault.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}