Setting environment variables in FGLPROFILE (mobile)

When executing applications on mobile devices, you can configure environment settings with FGLPROFILE entries. Setting an environment variable with an FGLPROFILE entry is equivalent to setting the environment variable before running the fglrun VM process on a server.

Note: Environment variables set in an FGLPROFILE file are only read when the deployed application runs on the mobile device. They are not read during development mode (that is when the VM runs on the development machine and the mobile client displays on the device). The FGLPROFILE environment variable settings are only for the VM component and are ignored by the GMA/GMI front-end component.

FGLPROFILE environment variables settings can be used to define DBDATE and DBFORMAT, if the default regional settings on the mobile must be ignored for date and numeric value formatting. Note that defining DBMONEY will have no effect, because DBFORMAT is defined automatically by the GMI or GMA front-end component before starting the VM component. Since DBFORMAT takes precedence over DBMONEY, setting DBMONEY in FGLPROFILE is pointless.

Important: C-runtime library variables such as LANG/LC_ALL cannot be set with FGLPROFILE entries, because the C-runtime library is (and must be) initialized before reading FGLPROFILE files.

The syntax is:

mobile.environment.env_name = "env_value"

where:

  1. env_name is the name of the environment variable to be set.
  2. env_value is the value for the env_name environment variable.

For example:

mobile.environment.MY_ENV_VAR = "my value"

The value specified in a mobile.environment entry can contain $NAME placeholders, that will be replaced by the actual value of the NAME environment variable. The NAME environment variable will typically be set by the front-end component, before starting the runtime system component, for example to define FGLDIR and FGLAPPDIR values.

If the environment variable contains directory or file paths, use the UNIX path notation with / slashes as directory name separator, and the : colon as path separator.

This example defines the FGLIMAGEPATH environment variable for the mobile app, using FGLAPPDIR and FGLDIR predefined environment variables:

mobile.environment.FGLIMAGEPATH = "$FGLAPPDIR/myimages:$FGLAPPDIR/icons/myimage2font.txt:$FGLDIR/lib/image2font.txt"
Note: During development (when executing programs on a server), consider defining environment variables such as FGLAPPDIR in the shell environment, along with the other environment variables that are defined with mobile.environment entries, as these are only read when executing on mobile devices.