Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


The Android peer-to-peer sync library is a library/component that enables apps to easily share their records/data with other devices when offline. The library supports 1-to-1 connection and the app can receive record/data updates from another app. This main purpose is to support data reporting up the administration hierarchy after it is collected on the ground where internet connection is scarce but administration has access to internet. It can also be used in many other device-to-device share use-cases

...

  1. Import the OpenSRP Client Core library
  2. Add the cwac-saferoom maven repository, as below


    maven {
        url "https://s3.amazonaws.com/repo.commonsware.com"
    }

  3. Add the P2POptions as below when initializing the CoreLibrary:

    1. P2POptions p2POptions = new P2POptions(true);

      // Add the optional configurations to the P2POptions

      p2POptions.setAuthorizationService(newChwAuthorizationService());

      CoreLibrary.init(context, new ChwSyncConfiguration(), BuildConfig.BUILD_TIMESTAMP, p2pOptions);