Framework for mobile/cloud synchronizing - android

I want to write an application that receives some data from the cloud. Additionally the data should be accessable, when the user is offline, which means I have to store it locally (sqlite or smth. similar).
Last week I read about CouchDB Mobile. This would be my solution if I would use a couchdb as online storage. But I don't want to use couchdb as online storage. Instead I am using Objectify in an appengine environment.
Is there a framework, which stores requested data local and checks for updates automatically? Or do I have to write that by my own?

I don't know of such framework that keeps a local copy of remotely accessed data from Datastore.
You could use the App Engine Java remote_api in conjuction with sqlite to keep a copy of the data locally and safe among app switches.
On the other hand that could raise an issue of consistency if the data kept locally has been modified by someone else in Datastore.

There is no such thing that I'm aware of.
Android has sync adapters, but that is just one piece - not an equivelent of what CouchDB does:
http://developer.android.com/training/sync-adapters/index.html
The new 'google cloud save' feature of play services, which is currently in closed beta, sounds like it could develop in that direction - currently it just makes saving/loading from datastore simple.
https://developer.android.com/google/gcs/index.html
And I don't think there is a silver bullet anyway. A framework can do a lot for you on the client, but sync'ing logic is not generic on the server side.

Check this out, i think titanium have an api to handle data sync.
http://docs.appcelerator.com/titanium/3.0/#!/guide/Alloy_Sync_Adapters_and_Migrations

Related

Mobile local databases with replication like Couchbase lite, Parse.com or Claudant can replace the Web services layer?

It seems that mobile local databases with sync capabilities are gaining some momentum in the mobile scene. That kind of approach can replicate data from the backend to the app (and vice-versa) without much effort. You won't have to write all that code in the app and backend to exchange information. It sounds awesome, right?
But, I was wondering in which cases the replication won't be efficient. What are the pros and cons of that approach? I'm particularly worried about too much data consumption on the mobile side and searching for info that's not on the local database.
I would argue that the replication approach available in CouchDB, Couchbase Mobile, PouchDB…actually saves on data consumption because there is a local database on each end of the replication. Instead of storing the data in a cache that would potentially be invalidated in time, the Sync approach looks for the diffs on each side and works out what’s missing and should be sent.
However, the sync approach doesn’t fit all use cases. If we imagine the example of a location based mobile application. There may be a feature to search for content around the user’s location. It wouldn’t make sense to replicate the entire server side database to the device to make that query. You can use REST API calls for those type of queries. And once a user has "bookmarked" locations, use the sync approach to make them accessible to all logged in devices.
In the case of Couchbase Mobile, the filtered sync is handled by the Sync Function and the REST API can be used for queries on the server side database.

Web service for data syncing between mobile apps

I'm looking for a solution to synchronize data between iOS and Android apps.
Maybe exist web-services with iOS and Android libs for this purpose?
EnduroSync from Orando Labs is a new product that does exactly what you are asking. There are clients for iOS and Android, with more coming.
Full Disclosure: I work at Orando Labs.
The EnduroSync clients allow you to create object data stores on the local devices. The clients are fairly sophisticated - data is modeled as native objects for each client we support (iOS and Android now, more coming). The clients work offline and online. The data is saved to an sqlite database locally.
As you change objects in your model, the deltas are recorded on the device. At some point, you can 'sync' the object data store. Syncing uses a commit/push/pull process (like git), but this is invisible to you. The sync brings your local copy up to date with whatever is on the server, and sends up any changes you have made. Conflicts are resolved using a timestamp based merge, so newer data is not overwritten by older data.
EnduroSync is an online service, so there is no server setup on your end.
There is also a flexible permission system which lets you share the object data stores in a variety of ways. For instance, most applications will have one or more object data stores for each user, for preferences, notes, tags, etc. You can also share object data stores per app, per user type, and with wild cards, many other ways.
So basically you use our client SDK's to model your data on the device. Modeling is with simple objects in the native programming language of the device. If you sign up for the syncing service, you get the syncing also.
I found the solution: https://parse.com/products/core The service also has social integration like facebook login, etc.

Syncing SQLite table over devices

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?
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.
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.

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:
have a web server with a database + web service calls. This has the disadvantage of having a host paid, learn some extra mysql + web service techniques.
store somehow the data on cloud and allow the app by login to access an account which stores the file. I am thinking here at something like Google Drive / Dropbox. But I don't know how I would be able to sync only the updated values, not the whole file. Because I am thinking, if I store all the tasks into one file, each time I update the file, I'll need to upload it fully, which is not the best approach.
I am open to any advices. What approach would you recommend ?
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.
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
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.
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.
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).

Mobile Development and Cloud Database, Where Should I Start?

I am an Android Developer and a noob when it comes to web technologies.
I am planning to create an Android app that stores its data to a database.
I do not want to maintain my own server so I guess I would be resorting to Cloud Services.
The thing is I do not know where to start.
What do I need to be able to access and store data to a cloud database from my Android app?
Where can I get a cloud database preferably for free.
Do I need to use web services?
Any help
There are a few things in this that make me ask questions, as opposed to answer them.
Do you mean for your application to be always able to communicate with the database, or will it be more of a backup/sync with a database you have on your handheld.
If you do intended the app to be live all the time, then just write a web app and construct it with small screens in mind. It would be faster and sort of cross platform.
If you intend to have the app just sync with a back-end.. Well then a simple web service should do you for storage. Yep. Rails would be the way to go.
It really depends on your users.. How will they be using the app? Where will they be?
Personally I like the stand alone application that just sync's with the back-end. It is less prone to crashing because I walked into a tunnel. It also lets me control when and where I am when I sync. But it means the data I'm looking at could be out of date. And the data I'm adding isn't right there for others to consume.. they have to wait for me to sync'.
Check out Amazon's AWS and their SDK for Android. Highly recommended.
I assume that you know Java and my solution would be GWT/GAE ,since you asked for web application,GWT https://developers.google.com/web-toolkit/ would be perfect way and also you could use Google AppEngine Store as Cloud service and also you can integrate GWT with Phonegap to run it in Android.

Categories

Resources