简体   繁体   中英

Parse.com: Deploy app with local DB

I use the Parse.com Cloud service in my Android app to sync data between devices.

I use the app mainly offline and use the local DB

Parse.enableLocalDatastore(getApplicationContext());

I want to deploy my app with a local DB that already contains a few thousand records. How can I do that? I don't want to sync the data on every device on first use.

Local datastore is not really a "local db", although you get some of the benefits a local db would give you. There is unfortunately no way to pre-populate the local datastore like you're after. The only way I can think of is to use another technology (like sqlite/core data etc) to store the pre-populated data. The problem is that to pin the data to the local datastore, you would need to get the PFObjects from Parse first anyway...

The Parse local datastore is not created to work as an offline database per se; only to offer an "offline mode" for your online data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM