I want to store two ParseGeoPoint objects: src and dest where src is the currentLocation of the user and dest is a location generated from an address using geocoding. Each user in my app must have or rather has a src and a dest. I created a ParseClass that has a ParseUser obj and two ParseGeoPoint objects namely src and dest. However when i attempt to store an instance of this class it returns a ParseException which states only 1 ParseGeoPoint object can be stored in a class. I understand that this may be a limitation of parse.
However i need them to be in the same class because : I intend to run queries to retrieve a list of users to the same dest and ordered by their src. In this way my app users can find other users in their proximity going to the same dest. The results are to be populated in a list view using the ParseQueryAdapter.
This is what i'm doing now. If it helps make the situation clearer
// Set up a customized query
ParseQueryAdapter.QueryFactory<UserLocationObject> factory = new ParseQueryAdapter.QueryFactory<UserLocationObject>()
{
public ParseQuery<UserLocationObject> create()
{
Location myLoc =currentLocation;
ParseGeoPoint src=geoPointFromLocation(myLoc);
ParseQuery<UserLocationObject> query = UserLocationObject.getQuery();
query.include("user");query.whereNear("src", src);query.whereEqualTo("dest", dest);
query.setLimit(MAX_SEARCH_RESULTS);
return query;
}
};
// Set up the query adapter
locationInfo = new ParseQueryAdapter<UserLocationObject>(this, factory) {
@Override
public View getItemView(UserLocationObject post, View view, ViewGroup parent) {
if (view == null) {
view = View.inflate(getContext(), R.layout.activity_find_poolers, null);
}
return view;
}
};
// Attach the query adapter to the view
ListView listView = (ListView) this.findViewById(R.id.listView_findPoolers);
listView.setAdapter(locationInfo);
Is there a way in which i can store the src and dest of an user so that i can easily query them and populate my list view. The list should be generated satisfying the above mentioned contraints.