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.
Related
I'm developing and Android app which provides content to the user.
I want to store the information of the data in a database on the cloud and locally, and to store the actual content also on the cloud, and access it via the information on the database.
I also want to be able to show the user content based on a date, and to check for that frequently.
I would also like to be able to update the content over the web, and show the user news and updates on the fly.
I'm new to this, and would like to understand this. I read all sorts of terms, but not sure which I need for what. GCM, Content Provider, SyncAdapter, database, AsyncTask, etc..
If someone could please give me an overview of how to do what I want, with an explanation, I would be very grateful.
Thanks!
I want to store the information of the data in a database on the cloud
and locally, and to store the actual content also on the cloud, and
access it via the information on the database.
About this requirement, I recommend you can use Azure Offline Data Sync feature to sync up your local and cloud data. Please refer to this documents:
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-xamarin-android-get-started-offline-data/
I would also like to be able to update the content over the web, and
show the user news and updates on the fly.
Notification Hub Service is for pushing the message to client and customer, if you want to use the similar feature, please refer to this documents :
https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-push-notification-overview/#integration-with-app-service-mobile-apps
I am developing an android app that measures the radio interface parameters of a network periodically, stores the data in SQLite DB and transfers the data stored to MySQL DB on a web server. How can I make this possible?
I've done some research on this and found only one usable option, which is to make a web service using json or xml to pull/push data between the two databases. You could create a database link between the two, but this is not advisable.
There are numerous questions with a more detailed scope for this issue and you should be able to find one that fits your use case. If not, ask a new question after this research with more details and what you've done so far.
I use Parse.com for storing my data but since they will shut down their service I am going to use Backendless in the future.
I use it in my Android app for syncing my data between devices. Since the app can work offline I will use a SQLite DB to store the data and sync it to Backendless when online. And new data from Backendless will be stored in the SQLite DB as well to be available when working offline.
So when offline and creating a new record, I have to store it in SQLite until being online again. Now can I set the ObjectId, which is the identifier of Backendless objects, manually and will Backendless still get that is has not been saved to the cloud even already having an ObjectId set?
Even if the backend accepts an external objectId (and I think it doesn't), it's safer to just drop the local ObjectId before sending the objects to the backend, and let the backend generate a new one. This way, you won't have to manage several ID generators and worry about unicity.
If you can't change the local ObjectId, you can still delete and re-create the local object with the backend Id.
I'm new in app engine.
I created an Java application using Google app engine. I populated a database offline. I can access it at my localhost. I know that the local dev server stores data in local_db.bin.
When I upload the app to the online dev server, it doesn't upload my database. It is possible to upload the local_db.bin?
Thank you for you help.
Copying/deploying the local_db.bin file directly to Google servers will have no effect and that file is intended only for the SDK that runs locally. On production the datastore is a service and all implementation and files are hidden away from the user. Thus you can't copy or change the format for the file to achieve what you want.
See this link for
datastore copy
Depending how much data you have and how often you need to populate it then it might just be easier to re-populate it online, create some basic data bootstrapping code/script or an API/import process.
Is it possible to use SQLite as a relational database from Google App Engine? (Java) I need read/write access to it from the app itself.
Also, I am using Quercus for PHP, and if what I am asking for is possible, I can handle storing the database myself.
No, it is not possible. This would require write access to the filesystem, which App Engine does not allow.
SQL database support (MySQL like) is planned, but no release data has been given. For now, use the datastore.
I know it's a super old question and nothing concerning read-only properties of App Engine has changed since then... But actually you can use sqlite on Google App Engine. There is a writable /tmp directory (https://cloud.google.com/appengine/docs/standard/java-gen2/using-temp-files). If your app on startup first copies the db.sqlite3 file to /tmp/db.sqlite3 and references this path as database path, it will work.
The following problems are connected with this approach:
This directory is "in-memory". So if you want to use really large sqlite file, you may face problems with RAM.
Each node of the app gets its own copy of the database. If you save something on one node, these changes will not be seen by other nodes. And the new data will be lost if the app scales to 0.