Friday 15 July 2011

android - How to retrieve more than 1000 rows from Parse.com? -


I am using paras to obtain data for list view. Unfortunately they limit up to 1,000 by default to 1000 maximum requests. That class is better than 1000 in my class, I got a link on the web which shows a way to do this on iOS, but how can you do it on Android?

I am currently adding all data to an array in a loop until all the items are complete (100) and then add them to the list

I have found out how to achieve your goal:

Announce global variable < / P>

  private static list & lt; Parse object & gt; All objects = new arreelists & lt; Parse object & gt; ();   

Create query

  last ParseQuery parseQuery = new parse ("Objects" ); ParseQuery.setLimit (1000); ParseQuery.findInBackground (getAllObjects ());   

Callback for query

  int skip = 0; FindCallback getAllObjects () Return to {new search callback (public) {list (list & lt; purse object & gt; objects, parsection e) {if (e == empty) {allObjects.add all (objects); Int. Limit = 1000; If (objects.size () == border) {skip = skip + limit; ParseQuery query = new pars ("objects"); Query.setSkip (left); Query.setLimit (range); Query.findInBackground (getAllObjects ()); } // We have a complete PokeDex else {// U.S.E. Complete data is INTENDED}}}; }    

No comments:

Post a Comment