Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a local cache on Android device for Parse Cloud Code function results?

I am using Parse with Android. I was using ParseQueryAdapter's API for querying and getting back results from the Parse database. However, the default queries cannot filter the content in the way I want and I am implementing a Parse Cloud Code function to get me the ParseObjects instead. The problem is that by using Cloud Code I have to give up all optimisations build in ParseQueryAdapter, especially cache-ing of results and pagination.

Can someone provide me a way to implement cache-ing for ParseObjects returned through Cloud Code? Thanks in advance!

like image 684
VarunT Avatar asked May 18 '26 14:05

VarunT


1 Answers

Parse released an update to their SDK just 3 days after this question where they added a local datastore feature. This can be used for caching any ParseObjects which are returned from CloudCode. Not the most elegant solution since it does not automatically cache network requests and you need to have all your data in the form of ParseObjects - but definitely makes life easier.

Check out their press release for details - http://blog.parse.com/2014/04/30/take-your-app-offline-with-parse-local-datastore/

like image 103
VarunT Avatar answered May 20 '26 04:05

VarunT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!