[aerogear-dev] Comparing sync in Android vs other platforms

Corinne Krych corinnekrych at gmail.com
Wed Mar 5 09:27:55 EST 2014


Hi All,

Json patch with HTTP patch method [1] are interesting to look at when it comes to send diff/patch.

++
Corinne
[1] https://tools.ietf.org/html/rfc6902

On 05 Mar 2014, at 15:18, Lucas Holmquist <lholmqui at redhat.com> wrote:

> For JS,  there isn't really anything except for maybe leveraging indexedDB upgrades,  but IndexedDB isn't supported everywhere.
> 
> Once Object.observe comes in,  then we are closer to comparing objects super easy
> 
> JS is very much DIY at this point
> 
> 
> On Mar 3, 2014, at 10:17 AM, Summers Pittman <supittma at redhat.com> wrote:
> 
>> For the DevNexus Android app[1] I used Android native sync APIs[2] + the 
>> sync strawman[3] I put out back in December.  It worked surprisingly 
>> well with a few caveats.
>> 
>> First a background on how Android sync works.
>> 
>> Android sync is handled by three components: a SyncAdapter, a 
>> ContentProvider, and a Authenticator.
>> 
>> The Sync Adapter performs as sync and returns a status object.  The 
>> SyncAdapter is called from, managed by, etc the Android platform. It 
>> provides an onPerformSync that the developer implements.  In the 
>> application the developer sends signals to Android which control 
>> scheduling sync (periodic, immediate, event based etc).  Also Android 
>> will put in the "Account" settings page a control for the SyncAdapter.  
>> In this case the SQLSynchronizer I proposed was used to implement this 
>> method.
>> 
>> The ContentProvider is responsible for CRUD operations on your data, 
>> exposing your data to other apps on the device, and notifying the system 
>> if data changes.  This is managed by Android as well.  In this case the 
>> CP was backed by a SQLStore.
>> 
>> Finally the Android Authenticator is responsible for establishing and 
>> maintaining authentication with remote services.  If the user is not 
>> signed in, or if fetching an auth token fails, the Authenticator will be 
>> called by Android to provide a Activity which can be used to refresh the 
>> users account.  In this case I used two custom AuthenticationModules.  
>> One handled SSO with Google and the other handled keeping the cookie up 
>> to date.  Both communicated with the DevNexus server to keep all of the 
>> tokens fresh.
>> 
>> Overall, Android provides a very VERY slick (but very very complicated) 
>> way of managing sync AND keeping the sync state visible to the user.  If 
>> you use Androids APIs then the OS handles things like Authentication 
>> errors, intermittent connectivity, etc while providing configuration for 
>> a variety of sync use cases (UI event based, polling, data listening, etc).
>> 
>> I tried looking up what options are available in JS land but the closest 
>> I came to was a FFOS blurb about it is a TODO item and isn't a W3C 
>> proposal or anything yet.
>> 
>> I tried looking at iOS but the docs made my eyes cross.
>> 
>> So what does the PLATFORM support look like in these environments?
>> 
>> ----
>> [1]https://github.com/secondsun/devnexusAndroid
>> [2]http://developer.android.com/training/sync-adapters/index.html
>> [3]https://github.com/secondsun/aerogear-android/tree/sync_strawman/src/org/jboss/aerogear/android/sync
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
> 
> 
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev




More information about the aerogear-dev mailing list