Question

Is it possible that I store my SQLite table over a dropbox account and have all my users sync their tables with the stored table? Also be able to make changes to that table?

Was it helpful?

Solution

Your approach could work in theory, but there are so many issues involved, that you're better off not doing it. If you wish to store and make data available across all devices belonging to a user, I strongly recommend looking into Datastore API by Dropbox. The API will take care of storing data locally as well as synchronize it over connected Dropbox accounts.

If you want a bit modular approach, you can use Windows Azure Mobile Services. These give you REST APIs to store your data in cloud. However, synchronization has to be handled by the developer - you. I have written a small library to do that here: http://bit.ly/ProjectMirror It's for Windows Phone, but Android version is already in a sister repo there. You could extend it. Let us know how that goes.

In addition to these services, Parse SDK is a good option. It requires you to pay after a while, though. In addition to what you want to do, it also provides other things like user management and so on. But, be aware that some of those operations may require you a live Internet connection.

So, in essence, if you want seamless data storage and sync, use Datastore. Be aware that you'll have no control over the server side. Also, your data will be restricted to the Dropbox ecosystem forever. If you plan on further expanding your app to other platforms, go with Azure and handle the sync. If you want lots of features, go with the Parse.

OTHER TIPS

I would suggest looking into Google Play Game Services using the Cloud Save feature. Even if you are not building a game this feature lets you sync sqlite data in the cloud and Google will handle most of the work for you.

OR you could use a cloud based database which supports both push and pull. That means:

Scenario 1: Your users change something on their phones. Changes are uploaded to the database. The database then pushes these changes to all other users.

Scenario 2: Your users change something and upload this to the database. But instead of the cloud based server pushing the changes to all users, the users phones can ask the database for new data at intervals.

All this is very easy to set up. It took me about five, ten minutes. Just follow this easy tutorial:

https://parse.com/docs/android_guide

and for push:

https://parse.com/tutorials/android-push-notifications

We now use this for our company app, storing statistics for example.

Bear in mind that syncing can become complex. Try to keep it very simple, especially if you are new at programming.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top