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. Why can't the app start receiving or sending mode after clicking on the button?
    • Make sure that the location is turned on. If it is turned on, try turning it off and let the application turn it on
    • Make sure that you accept the location permissions from the prompt displayed
  2. Why does the screen keep on closing after opening it?
    • Make sure that the device has Wifi enabled since it uses the Wifi Mac address as the unique identifier

How to use it in your project


Detailed and updated instructions on how to add it in your Android project can be found here. For use in OpenSRP clients, below is the guide on how to integrate it.


How to use it

...

on OpenSRP Clients


This library has already been integrated into OpenSRP Client Core library and currently supports sharing events, clients and profile images. The default authorization implemented for OpenSRP Client Core makes sure that both the sender and receiver are in the same team by:

...

  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);

...