I have pinned object for first time. Next time i try to fetch same object it takes time sometimes like 5 to 6 second in this the screen turns blank.
Here is my code for pinning. (Both pinning and querying data from local store is done on same table in parse)
ParseQuery<ParseObject> query = ParseQuery.getQuery(PARSE_IMAGE_TABLE);
List<ParseObject> images = query.find();
for each image i get i do following:
parseObject.pinInBackground(PARSE_PIN_WALLPAPER_INFO,
new SaveCallback() {
@Override
public void done(ParseException arg0) {
System.out.println();
}
});
When querying:
ParseQuery<ParseObject> query = ParseQuery.getQuery(PARSE_IMAGE_TABLE);
query.whereEqualTo(PARSE_IMAGE_THUMB_URL, imageURL);
query.fromLocalDatastore();
query.fromPin();
List<ParseObject> images = query.find(); -- this call takes time
Yes their is a lot of performance tweaks you can do in your code. Pinning a list of objects is faster and better approach.
Instead of using find query use findInBackground.
Also start using pin(String name) and fromPin(String name) instead of fromPin() and fromPin(String name). This has a huge advantage if you have a lot of rows in your parse local storage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With