[feedhenry-dev] New fh-sync-android initialization

Vojtech Sazel vsazel at redhat.com
Fri Sep 8 18:48:06 UTC 2017


Hi,

I followed up the work started by Wojciech and made decoupled Android
fh-sync-android working.

Changes done:
1) Network calls are not static, but done through NetworkClient is now
interface, with NetworkClientImpl having implementation with OkHttp Android.
2) Dataset storage is written against FileStorage with implementation
FileStorageImpl that uses internal Android storage in files (as was in old
sync)
3) Client unique Id generator was added in ClientIdGenerator an
ClientIdGeneratorImpl,
this is needed by cloud app to properly sync (done the same way as in old
sync)
4) FHSyncListener and  FHSyncConfig improved, with new initialization for
Android apps

For Android initialization it's now needed to use Sync.init(Application
application, FHSyncConfig config, String cloudUrl) method
in your Application object like this:

public class SyncApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Sync.init(SyncApplication.this, (new
FHSyncConfig.Builder()).useCustomSync(false).syncFrequencySeconds(10).notifyEnableAll().build(),
"http://192.168.13.14:3000/sync");

    }
}


When fh-android-sdk wrapper is written it should be still backwards
compatibile with current old sync.


-- 

VOJTĚCH SÁZEL

SENIOR QUALITY ENGINEER, MOBILE QE

Red Hat

<https://www.redhat.com/>

Remote Czech Republic

vsazel at redhat.com    IM: vsazel
<https://red.ht/sig>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/feedhenry-dev/attachments/20170908/ef52f743/attachment.htm>


More information about the feedhenry-dev mailing list