Collecting & Analyzing Data on an Android Device

PAGE 6 of 12

View Table of Contents

Preload Data on Mobile Devices

Introduction

In some scenarios you might need to preload a mobile device with some data from the Epi Info™ 7 desktop project.  For example, if you need to visit specific addresses to follow-up on the health status of patients, you might want to have basic information preloaded in the parent form such as the addresses to visit and the names of patients and their patient ID.  Then you could have the visit information and health status as dependent records or child records to the patient (parent) record for collection on the mobile device.

When it’s time to bring data back into Epi Info 7, it is important that the correct records are updated on the desktop.  The Mobile Companion for Android does this by ensuring referential integrity which means it makes sure the app and desktop tools can match each record’s GlobalRecordID and foreign key.

This functionality is intended only for seeding a few columns and a few records of data needed for completion or data entry in the field. It is not designed to facilitate continuous integration of data between the desktop and mobile devices.  While you can potentially preload a mobile device with all records in a database, it is not recommended for large databases. Therefore, we recommend that you reduce the size of the preload file to specific records you plan to use during that data collection session. We also recommend that you select specific variables or columns for preloading, rather than all variables in the form. In doing so, be sure to include the GlobalRecordId.  The GlobalRecordId is needed in order to import the completed records back to the project on the desktop.

The Preload Data process is considered an INSERT ONLY operation.  It does not overwrite existing records on the device with new or different data. If a record in the preload data file has a GlobalRecordID that already exists on the mobile device, that record is ignored and not preloaded onto the mobile device.

In general, the process to preload data from an Epi Info™ 7 Project involves creating a comma separated value (csv) file and transferring this file to the mobile device.  The step by step instructions to accomplish these two tasks are described below, however, some options and menu items may be different depending on the make and model of your specific device and its Android version.

Step 1: Create the Preload CSV file

1.     Open Classic Analysis.

2.     Use the Read command to read the project into memory.

3.     Use the Select command to reduce the number of records to just those you want to preload to the mobile device.  This step is optional if there are only a few records. However, you should avoid prepopulating an entire database with many records unless it’s absolutely necessary.

4.     Finally, use the Write (Export) command to write out the selected records using the “CSV File” format selection.

In the Write dialog, select the variables to export from the list.  Be sure to include the GlobalRecordID, or specify all fields using an asterisk (*).  Either way, the GlobalRecordID must be included.

For the Output Format, select “CSV File”.

For the Connection Information, specify a folder on your computer where you can find the new file.

The Destination File should use the name of the form ending with “.csv”.  Figure 6-27 shows the Write dialog set up to export the FoodHistory form of the sample Ecoli project.  Notice the Destination File is “FoodHistory.csv” since the name of the form is “FoodHistory”.  It is very important to name the file the same as the name of the form in order for the app to recognize the file and preload the data into the device.

Write dialog showing settings for creating the Preload CSV File

For more detailed information about using the Classic Analysis tool and the commands for Read, Select, Write and others, please see the Classic Analysis section of this User Guide.

Step 2: Transfer the Preload CSV File to the Mobile Device’s Preload Folder.

There are several methods to transfer data to a mobile device. The most common methods are described below but the objective is the same–to get the new CSV file into the Download>EpiInfo>Preload folder on the mobile device.  Menu items and options shown below may be different on your specific device depending on your device’s make, model, and Android version.

After transferring the file to the Preload folder on your device, when you start the app, the app will automatically import data from every CSV file to the corresponding form on the device based on the shared file name and form name. The GlobalRecordId’s are persisted during this import so the data collected/updated in the field can be brought back into Epi Info 7 desktop.

You can transfer the preload csv file in one of three ways depending on your situation:

Transfer Preload File by Direct Cable or Wireless (Bluetooth) Connection

1.     Locate the CSV file created by Classic Analysis.

2.     Right-click the file and choose “Copy” from the context menu, or select the file and press CTRL+C to copy the file to the clipboard.

3.     Connect your device to the computer using the device’s cable, or enable a Blue Tooth connection to the device.  You may get an message asking whether to allow the computer to access files on the device.  Touch “Yes”.

4.     On the device, open “My Files”.

5.     Touch “Internal storage” and navigate to the folder Download > EpiInfo > Preload.

6.     Right-click the Preload folder and select “Paste” from the context menu, or press CTRL+V to copy the CSV file from the clipboard into the Preload folder.

Transfer Preload File by Email

1.     On the desktop, open your email application and attach the CSV file to a new email.

2.     Send the email with the attachment to an email address you can access on the device.

3.     On the device, open the email and download the attachment*.

4.     Locate the attachment in the Download folder and select “Move” from the Options menu.

5.     Navigate to the Download > EpiInfo > Preload folder and click OK to move the file.

*Note: If you save the file with the extension “.pre” instead of “.csv”, then your device might ask what app you want to use to open the file.  Select EpiInfo and the Epi Info™ Mobile Companion will automatically copy the file to the Preload folder.

Transfer Preload File by Messaging App (e.g. WhatsApp®)

If you have a messaging application on your desktop computer such as Skype for Business or the WhatsApp® desktop software, then you can use this to transfer the preload file from the desktop to the mobile device.

1.     On the desktop, use File Explorer or another method to rename the CSV File to have the extension “.pre” instead of “.csv”.  You may get a message that changing the file name extension might make the file become unusable and asking if you are sure you want to change it.  Click “Yes”.

2.     Open your messaging app.

3.     Start a new message and click the icon to attach a file to the message.

4.     Send the message to an account that is accessible from the mobile device.

5.     On the mobile device, open the message and touch the attached file.  If this is the first time a .pre file was sent through the messaging app, it might ask what app you want to use to open the .pre file.  Select the Epi Info™ Companion for Android.  Since the comma separated value file has a .pre extension*, Epi Info™ recognizes this extension as a preload file and copies the file to the Preload folder .

*Note: If you received a comma separated value file that has the .csv file name extension, instead of the recommended .pre extension, your device might try to open the file in its default spreadsheet app.  Use ‘Save As’ or ‘Move’ to copy or move the file to the Download > EpiInfo > Preload folder.  You can also use “My Files” to move the file.

WhatsApp® is a registered trademark of Facebook, Inc.