[aerogear-dev] More Sync

Summers Pittman supittma at redhat.com
Tue Dec 10 10:49:37 EST 2013


So as I mentioned in the meeting I am dog fooding some sync ideas on 
Android in the form of a DevNexus app.

Here are the two main interfaces that have precipitated out so far:

https://gist.github.com/secondsun/df6724e89d7ae06cbb64

*Warning Android Gory Details begin here*

I am working towards a PeriodicSyncAdapter that I mentioned in a 
previous email.  Android has this type of functionality built in but it 
is VERY VERY heavy on boilerplate, XML, and complexity.  I want to build 
something which is lighter.

My current idea is to create a BroadcastReceiver which users can 
register.  The SynchronicationConfigs (no code to share but they are 
just Key/Value Pojo's) will be instantiated into Synchronizers using a 
Sychcronize factory class (think Pipeline).  The Sychcronize factory 
will tell the BroadcastReceiver about the Synchronizers, but the 
Sychronizers will be what does the data loading, saving, scheduleing, etc.

The Synchronizer and BroadcastReceiver are separate classes.  The 
BroadcastReceiver will be setup in the AndroidManifest.xml file and the 
Synchronizer will be managed by user code.  The reason they 
BroadcastReceiver isn't managed by user code is because Android won't 
wake up code which isn't in the AndroidManifest.  IE if a sync event 
happens while the app is not running then the sync will not happen.

Summers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20131210/d1ffd172/attachment.html 


More information about the aerogear-dev mailing list