Relational query and near - Order by distance -

Friday, July 4, 2014

I'm dealing with an issue and I can't solve it, here we go:

I have exactly the same problem as described here, I tried Fosco Marotto's solution (He's a Parser) but didn't work :

My current situation: I have a class ITEM with a Pointer to another class USER which have a field "location" that is a GeoPoint.

All I want is to show all the items near of a given location order by nearest first.

Here's my query:

ParseQuery mUserQuery = ParseQuery.getQuery(User.class);

ParseQuery mItemsParseQuery = ParseQuery.getQuery(Item.class);

It works, but items retrieved are not sort by distance

It's possible to do that? Some suggestions?