Alin
Alin

Reputation: 14571

How to sync data between different devices

I am planing to implement an app and I have come to a point where I don't know what is the best approach.

Scenario:

I have an app where I am making a todo list and I am adding 3 items. I use my phone for this. Then I take my tablet and want to continue adding another task. Then after a while I take my wife's phone and want to add 2 new tasks.

Basically I want to have a very simple way of storing the tasks online and be able to sync it with the app.

I am seeing two possible ways:

I am open to any advices. What approach would you recommend ?

Upvotes: 25

Views: 26040

Answers (5)

VivekRajendran
VivekRajendran

Reputation: 736

You can try Google's Firebase. Firebase provides SDK for Android and iOS devices. And also, firebase supports offline and syncing. Firebase also provides object storage service. It easier to create firebase app than you think. Have look at this firebase's firestore service.

Upvotes: 1

Mike
Mike

Reputation: 5572

There's also Google Drive's "Application Data" folder.

https://developers.google.com/drive/android/appfolder

This has the advantage of using the user's storage space.

Upvotes: 16

You can take a look at our Rethync framework (freeware with source) . Using it you can simplify the task of detecting modifications and sync only updated data. Next, Rethync provides both client- and server-side API so you can create your own service (and host it on the web side) or you can write your own transport for the cloud service of your choice (we will provide some transports in future, they are under development now).

Upvotes: 0

Joe Malin
Joe Malin

Reputation: 8641

Take a look at the new training class for sync adapters: http://developer.android.com/training/sync-adapters/index.html for the basics of sending data from your device to a server.

On the Android device, I suggest you store your tasks in a content provider. This helps you keep track of updates since the last time you synced. You can then query the provider during your sync, send only the data that's been updated, and store the data on the server.

You should probably store the last update time on the device, so you can tell if the server contains data that isn't yet on the device. Remember that you'll have to download tasks as well if you want all devices to be in sync.

Upvotes: 3

tyczj
tyczj

Reputation: 73753

I would look into either Google App Engine or Amazon Web Services. They both give you free allotment of usage per month and if you go over then you start paying, chances are you wont get past the free tier for a while.

AWS is a bit more mature than GAE currently and seemed to be a bit easier to implement that GAE was when I was researching them

Upvotes: 9

Related Questions