Skip to content
Matthias Görges edited this page Sep 5, 2018 · 15 revisions

The EMBED file is an optional list of files in the application directory to be embedded into the application binary. These files will be extracted into the system directory when the application is first run on the target device. Subsequent runs will not overwrite the files. For example, this makes it possible to transfer default configuration data, databases etc. In particular, embedding circumvents problems accessing resource files on Android, where normal apk resources are located inside a zip archive.

For example, an EMBED file with the content

config/settings config/database

will pack the files config/settings and config/database in the app directory into the app. After launch on the target device, the settings and database files will appear in a config subfolder of the system directory, as reported by the (system-directory) call.

To have a file always be extracted, even if it exists, put an exclamation mark before the filename. For example, an EMBED file the content

config/settings config/database config/localizations.csv

will extract the config/settings and !config/database only if they don't already exist, but will always extract the config/localizations.csv every run. This means that any local changes to this file will be overwritten, but also that changes can be bundled with your app and even if you app is already installed (the file exists), your changes will take effect.

Clone this wiki locally