ODK-X Tables: Internal Details

Layout of Application Files

The layout of a Data Management Application is as follows:

  • /sdcard/opendatakit– directory containing all ODK-X applications. Each application is a sub-directory within this directory.

  • /sdcard/opendatakit/default – default application name (directory) for the ODK-X tools

Within the application folder (/sdcard/opendatakit/default), the following directories are present:

  • config – contains read-only configuration files that define the user's application (for example, the 5demos example application you just synced from https://opendatakit-tablesdemo.appspot.com). Within this folder are:

    • assets – contains files that initialize your data tables (in the csv sub-folder) and define the custom home screen and provides CSS files for overall appearance of your app, and JavaScript libraries and files for common behaviors in your app.

    • tables – contains directories that are named with table ids. Within these sub-directories, the ODK-X Survey forms and table-specific HTML, JavaScript, and CSS files are found. For example, the HTML file describing the list view for the tea houses table is found in config/tables/Tea_houses/html/Tea_houses_list.html.

  • data – contains the database and row-level attachments (files).

  • output – contains files that are generated (such as detailed logging files) or exported (such as CSV files) by the ODK-X tools on the device.

  • system – an area maintained by the tools themselves (ODK-X Survey, ODK-X Tables, ODK-X Scan, and so on). These files are extracted and placed here by the APKs. You should not modify files in this folder; when first started, the ODK-X tools sweep this directory to verify that these files match their internal copy. Any deviant file is replaced with a fresh internal copy.

The automatic configuring and loading of data into ODK-X Tables is governed by the config/assets/tables.init file. It provides a list of table ids and the CSV files (located in the config/assets/csv folder) that should be imported to populate them. This is discussed in more detail in the Tables User Guide.

Note

This file is the only configuration file that is not synced to the server. This is to optimize start-up of your application on other devices; once this initial data has been loaded into your data tables and synced to the server, the other devices will obtain the data through an ordinary sync action.

Note

This file is scanned once. If the import(s) fail, it could leave some tables partially initialized. The file will be re-processed and data rows re-loaded by clicking on Reset Configuration on the Settings screen then exiting the ODK-X Tools and re-launching them. Upon being re-launched, the file will be scanned and processed.

Most of the app-level settings that are configured through the Settings page are stored in the config/assets/app.properties file. Excluded from this file are the Server Sign-On Credential type, and the values for that credential (such as username and password). This allows the application designer to specify and enforce most of the app-level settings (such as the server used when syncing) via the sync mechanism.