Skip to content

Instantly share code, notes, and snippets.

@maanuanubhav999
Last active September 21, 2021 15:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maanuanubhav999/e6b2899dd308d35320a90ff215f312d7 to your computer and use it in GitHub Desktop.
Save maanuanubhav999/e6b2899dd308d35320a90ff215f312d7 to your computer and use it in GitHub Desktop.
Work Product - Google Summer of Code 2021 - Google FHIR SDK - Anubhav Sharma

Google Summer of Code 2021 Work Product

Student : Anubhav Sharma

Project : Research on Peer to peer data transfer

Organization : Google FHIR SDK

Mentor : Ephraim Kigamba

Android FHIR SDK Peer to Peer transfer (Proof of Concept)

The Android FHIR SDK currently does not supports transferring of data without the internet(Offline capabilities), as the app is intended to be used in areas that can be far from network reach, and in this condition, we wanted to transfer the data without the internet to another device.

By working on this project, the data could be shared to a nearby device without having a dependence on the internet. Currently, for GSoC, we have limited ourselves to researching and exploring various methods available to us.

Issue : #258: [R&D] Peer to peer sync capabilities

What work was done

We have worked on two demo applications which were based on wifi-direct API and nearby connections API-based library and tried to draw the comparison.

These applications were then tested for transfer, connectivity, etc., and the analysis of the basics is written.

Research Goals

  • Research on various technologies that would serve as the base for further development.
  • Develop Proof of Concept for different technologies that emerge in Research.
  • Further documentation regarding the Detailed Research can be found at Research Document
  • Sample applications regarding the research are attached below.
  • Research Guidelines

Sample Applications

Wifi-Direct Sample/demo

  • This application is based on Wifi-direct and the project was originally forked from Google Git
  • For further reference on the Technology Wifip2p
  • Application APK can be found here
  • Location needs to switch on, otherwise will throw Discovery failed: 0
  • Advantages
    • Faster than Android P2p Sync, Since Nearby Connection API may fall back to Bluetooth for transfer
    • Does not require an intermediate access point.
    • Can handle large data easily
    • Encrypted WPA2
    • During testing, tranfer speed varies between 2-3 MB
  • Disadvantages
    • Since we are using the API there is a lot of boiler code to be written, many edge cases to be covered.
    • Implementation is time-consuming.
    • Manual configuration changes for Wi-Fi-direct.

Android-P2p-Sync

  • This application is based on Nearby Connection api which is further developed into a library by OpenSRP.
  • For testing purposes, Android FHIR SDK reference was integrated with the android-p2p-sync library can be Found here
  • While integrating the library there were few issues with Jacoco and hence Jacoco was removed, attaching the link for intrigratable branch of android-p2p-sync library.
  • Application APK can be found here
  • Advantages
    • Easy to integrate to SDK.
    • Library already has its Database and it keeps track of the last record that has been send and thus all the capabilities that are required for syncing are satisfied.
    • Reduces steps like manual switching wifi/ Bluetooth.
    • Authentication before transfer.
    • Library's Database is encrypted hence secure.
  • Disadvantages
    • Sometimes the devices will not connect. (Reason not known)
    • Technology seems like a black box since the developer cannot decide how the data will be transferred, or on what basis it will use Bluetooth / wifi.
    • As Nearby Connection can fall back to using Bluetooth, sending larger files may take a long time.

To do

Decide on the technology to use and further develop and integrate it with SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment