Mobile client - Develop mobile apps

Mobile applications are fully based on classes and representations. There is no support for Classic mode.
On the server, the description of classes and representations used remains the same as for the desktop although there are some differences depending on the kind of mobile app.

Developing mobile application is done by the following steps:

  • Creating a class and a representation
    This first step is not described here since it follows the same rules as for desktop development.
  • Publishing a representation as a mobile app
    This step describes on how to make a new representation available in the mobile client welcome page, see Basic user interface
  • Optimizing page layout
    The mobile client offers a rich set of layout rules and options to allow creating responsive mobile apps which adapt to the screen sizes of various devices. This last and potentially complicated step of developing a mobile app is described in Design pages.

Publish a representation

Mobile applications are made of dashboards which reference to gadgets

This relation it the base for all mobile applications.

To publis ha representation and create a new mobile application:

.1 Create a new gadget of type representation referencing the representation to be published. See gadgets for details.
2. Create a new dashboards referencing the gadget which was just created.
3. Create a new mobile application referencing the created dashboard as home dashboard.

Note: It is also possible to not create a dashboard as described above but to set the created gadget as "home gadget" in the mobile application. This is a very simple way for small mobile applications which want to directly show a single representation once they are started.
The approach of creating a mobile dashboard instead is more flexible since it allows to show one or more gadgets in a dashboard like page when starting a mobile application.

Types of mobile applications

There are two types of mobile applications
Online only applications and applications which support offline mode too.

Online only mobile applications

These applications require a stable network connection to the server all the time. They do not offer a fallback if the connection drops.

Pros:
* First start of a mobile application is faster than offline ones
* Displayed data is always up to date
* When editing data, every change is sent to the server immediately
* Business logic is executed on every change done on client side
* Because of the above, potentially better user experience

Cons:
* No support for extended offline features like drafts

Offline capable mobile applications

These applications do not require a stable network connection to the server all the time, also it is still recommended. They offer a fallback if the connection drops and allow entered data to be stored as a draft.

Pros:
* All pages visited by the client before can be visited without network connections since data and metadata is cached client side
* Fallback mechanism to avoid loss of used input on connection issues

Cons:
* When starting a mobile application for the first time, all meta data is fetched from the server. This includes prototypes of all referenced representation. This can take a long time to finish and requires the whole meta data to be consistent.
* Data exchange with the server is done only when saving
* Business logic is executed on save only and not on every change. This has to be considered when developing business logic since not all X3 events will be triggered as expected. E.g. when adding a new line to a grid, there is no way to populate it with default values since the server will not be notified.