Deprecated - Linking to External Files (Videos, etc.) in CommCare Android Forms



Deprecated

This feature stopped working on all Android 7+ devices and now due to the recent changes to accessing storage in Android 10, it's not technically feasible to support this feature going forward. Our team will be working on a feature to support external files in the future.



Background

Occasionally it is helpful for a device to have large multimedia files (like videos which are hundreds of megabytes) stored on the device unmanaged by CommCare so that installs are not enormous but the content is still available.

Using Markdown in CommCare Android you can link to a video or other file on your device's local filesystem. When this link it clicked, Android will allow you to open the video with an external video playing application on your device.

 

Instructions

To get started, you'll need to place the video on the device (with a USB or similar method), and find the path to the file you want displayed.

The easiest way to do this is to install an app like Amaze File Explorer, locate the file, select it, and view its properties. The final path will look something like

/storage/emulated/0/Download/yourvideo.mp4

In order to make android recognize that you are trying to load the file, you will need to add the prefix

file://

to that path. This will result in a path that looks like (note the 3 slashes)

file:///storage/emulated/0/Download/yourvideo.mp4

This file path may or may not work between two different devices. So make sure you are capturing it on the type of device you are planning to use.

Next, in Form Builder, add the markdown-formatted text as defined here for example:

 

Where the square brackets contains the display text and the parentheses contain the path to the video file on your device.

On Phone

This will render as: