CommCare with Wi-Fi Direct
Important to Note
Usage of this feature necessarily involves multiple users and devices, complicating the ownership chain and form submission. Please use this feature only in situations where the offline workflow is explicitly needed as outlined below
Intended Workflow
This feature was designed for projects where devices may need to remain in areas with no connectivity for long periods of time.
Workers would use the devices to gather forms as usual, but instead of syncing forms directly to the server the workers would transfer forms to a host tablet.
This host would then be returned to an area with Internet connectivity and sync all the forms to the CommCare HQ server.
Once uploaded to the server, the forms will not appear or behave any differently than if they had been uploaded through the regular process.
These forms can be operated on by different devices.
Technical Requirements
Using Wi-Fi direct requires a phone or tablet running Android 4.0 later.
You also need to make sure the specific device supports Wi-Fi Direct.
Instructions
Ensure than Wi-Fi and Wi-Fi Direct is enabled on your device (note that these are separate functionalities) Refer to your device's guide on how to do this.
Note - even if you don't have a Wi-Fi network, Wi-Fi still needs to be enabled on most devices to use this functionality.
Note - these instructions are written for two devices. However, many clients can connect to the host without syncing to the server.
We've also observed that the Wi-Fi Direct technology can sometimes get into a bad connection state where the phones both think the other is in a different state than it is. The easiest way to fix this is to toggle your device's Wi-Fi connection on and off.
If you encounter an error in this process, please connect the device to the internet and submit your device's logs to the server by going to the CommCare home screen, pressing the settings button in the top right of the screen twice, selecting the "Settings" options, then pressing the settings button in the top right again, and selecting the "Force Log Submission" option.
Setting up the devices
Client- Transfer Forms
The first device has collected forms as usual, this forms would have been filled in offline. Please note that a user logging in for the first time in a device still requires internet connection.
Navigate to the home screen of CommCare and select the "Settings" button
Select "Advanced" and choose "Wi-Fi Direct" from the drop down menu
Select "Transfer" at the dialog screen, this indicates that the device will send their forms to the host device
Host - Receive Forms
Navigate to the home screen of CommCare and select the "Settings" button (It doesn't matter with which user you login as all forms will show up on HQ under the original client user)
Select "Advanced" and choose "Wi-Fi Direct" from the drop down menu
Select "Receive" at the dialog screen
Wait until the device's status is showing the success messages for setting up host group (requires Wi-fi Direct to be enabled)
Setting up the connection between the devices
Client
When both phones have completed these steps, the client device should press the "Discover" button
This will populate the list of other devices you can transfer forms to
From the list of devices, select the host device you want to connect to. You can determine the address of your phone next to the "My Device" icon at the top of host phone's screen
Host
The host device now needs to press "Accept" to begin the connection
Wait a moment until both devices read "Connected" on the peer list
When this is done, the sending device can press the "Transfer Forms" button to begin form transfer
After this process, the host device will acknowledge the transfer and the number of transferred forms will be shown
Host - Upload Forms/Syncs with CommCare HQ
When the host has connectivity, again select the "settings" button at the top right of the home screen and select the "Wi-fi Direct" option
Select "Send" from the dialog screen
Then select "Submit" and forms will be sent to CommCare HQ (this step requires an internet connection)
If you encounter an error in this process, please connect the device to the internet and submit your device's logs to the server by going to the CommCare home screen, pressing the settings button in the top right of the screen twice, selecting the "Settings" options, then pressing the settings button in the top right again, and selecting the "Force Log Submission" option.