Connecting Template Application to Mobile Platform Server

To use a template application, set up connection to a mobile platform server:

NOTE. Names of objects used in connection settings correspond to names in application code. If an object is renamed, rename the object in application code. All constants that are related with interaction between an application and a mobile platform server are contained in the HHFWConstants interface.

  1. Add environments with names:

  1. Add a project named stencil in the stencil_D environment.

  2. Add API users and a group of users in the stencil project.

NOTE. The example of connection setup uses the following API users: Petr1, Ekaterina2.

  1. Add API users to group of users.

NOTE. If a template application is used only for working with Foresight. Analytics Platform, it is enough to execute steps 1-4. When synchronizing resources the template application may return role loading error that does not affect template application work.

  1. Connect a PostgreSQL data source in the project, add credentials and create resources without caching with names:

NOTE. Resources tables must contain the structure specified in examples. Table fields must not be zeroable.
The configured resources will be hidden from the user in the application.

Examples of resources structure

  1. Set up connection to nfs4 file resource and create the SYSTEM directory.

The SYSTEM directory stores user avatar images displayed in application interface, for example:

NOTE. To automatically set user avatar, make sure that image name matches with user login that is set in the SYSTEM_R4users resource.

Example of directory contents

  1. Allow access for a group of users to configured resources.

  1. Add credentials for API user to connect to PostgreSQL data source and file resource with the SYSTEM directory.

  2. Connect required data sources and import resources.

Template applications use resources with determined structure.

Structures of resources

  1. Copy the configured stencil project to the stencil_Q and stencil_P environments.

After executing the operations set up connection to a mobile platform server in a template application. Set mobile platform URL, project and environment name and select working mode in application settings:

See also:

Mobile Application Templates | Example of Connecting Application to Foresight Analytics Platform