1. Home
  2. Analyzing Data
  3. Data Visualization
  4. How to: Using media files in Ona forms
  1. Home
  2. XLSForm Authoring
  3. How to: Using media files in Ona forms

How to: Using media files in Ona forms

Add media files directly to your ODK Collect folder to use in forms

In cases where mobile data or WiFi connection is limited, downloading large media files from your Ona account to ODK Collect may be challenging. In this case, you can manually add media files to your device(s) instead of uploading form media files into Ona.

Below are step-by-step instructions on how to add media files to your /odk/forms directory on your device’s storage:

  1. Connect your device to your computer using a USB cable, double click on the /sdcard/odk/ directory;
  2. Within that directory, locate the media subdirectory associated with your form, in our case, we will double-click on Birds-media;
  3. Drag and drop all of your media files into that media subdirectory;

Note: For Android 10.x (and later) devices, the directory will be /sdcard/Android/data/org.odk.collect.android/files

Author an XLSForm that captures or records media

Adding a question for capturing photos

It is possible to introduce questions that will launch the smartphone device’s camera during data collection. This tutorial XLSForm illustrates how to include questions that allow one to capture an image. In your XLSForm, the question type for such a question should be an image. In ODK Collect, the image capture relies on the configuration and capabilities of your device’s camera application.

You either launch the camera by tapping on the Take Picture button or select an image stored in your device’s storage by tapping on the Choose Image button.

When collecting data via Enketo the camera cannot be launched, but the image will be uploaded from your local drive.

Adding a question to record audio or video

Yes, it is possible to introduce questions that will launch the device’s audio or video recorder during data collection. For example, to collect an audio or video recording, you would write your questions as follows in your XLSForm:

survey
type name label
audio audio_recording Take an audio recording
video video_recording Take a video recording

When collecting data using ODK Collect on your device, you can either tap on the Record Sound or Record Video button. You can also select a recorded audio or video file from your device by tapping on Choose Sound for audio or Choose Video for video.

Note:
Audio capture relies on the configuration and capabilities of the device’s audio recorder app. On newer 4.x devices and tablets, the inbuilt audio recorder app may not provide a good user experience when launched from ODK Collect. To get audio capture to work on devices that do not come with a built-in audio recorder, install RecForge Lite which is a free third party app and may also provide a better experience.

Viewing media files captured during data collection

On the Project page, select the form that you wish to view the media data captured then follow the instructions below:

  1. Navigate to the form’s Table tab, scroll from left to right on the data table to locate the media file question;
  2. Double-click on a row, and from the single submission view you will be able to see the media file (i.e. image, video, or audio). You can also click on the media file name to view or download a specific file;
  3. You can also view images on the Photos tab. The Photos tab lets you view all the images from your form in a slideshow format. Read this guide for more information.

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support