Salesforce

Interaction with the Mobile Device (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Interaction with the Mobile Device (Magic xpa 3.x)

File system and file operations

Mobile devices support local file operations using the appropriate functions. The naming conventions for local folders and file names are according to the device’s OS.

  • Names are not case-sensitive.

  • Folder separators are defined using a slash mark (/).

Access to the different device folders depends on the device. For example:

  • On Android, you can access different folders.

  • On iOS, the access is allowed only to a temp folder provided by the OS.

    When using the ClientFileXXX functions with a relative client filename, the file folder will be the cache folder. When using these functions with a full path, it is recommended to use ClientOSEnvGet('temp') to retrieve the cache folder.

Querying device characteristics

The ClientOSEnvGet function enables a developer to query for specific device capabilities or features and use it for conditional execution of logic.

On mobile devices, the following predefined keys can be used to return device information:

  • ClientOSEnvGet ('device_os') – returns the device operating system

  • ClientOSEnvGet ('device_screen-width') – returns the device screen width in portrait mode in pixels

  • ClientOSEnvGet ('device_screen-height') – returns the device screen height in portrait mode in pixels

  • ClientOSEnvGet ('device_physical-width') – returns the device physical screen width in portrait mode in inches
    Note that this value may not be accurate on all devices since the device OS returns inaccurate DPI values.

  • ClientOSEnvGet ('device_physical-height') – returns the device physical screen height in portrait mode in inches
    Note that this value may not be accurate on all devices since the device OS returns inaccurate DPI values.

  • ClientOSEnvGet ('device_orientation') – returns the device screen orientation

  • ClientOSEnvGet ('device_os-version') – returns the detailed device OS version number

  • ClientOSEnvGet ('device_model') – returns the device model number or name

  • ClientOSEnvGet ('device_touch') – returns “1” if the device has a touch screen

  • ClientOSEnvGet ('temp') – returns the cache folder of the application on the device. Android support – Since version: 2.3a

  • ClientOSEnvGet ('device_location') or ClientOSEnvGet ('device_location|xxx|yyy') – returns the current device location

  • ClientOSEnvGet ('device_magic-version') – returns the RIA client version number

  • ClientOSEnvGet ('device_udf|getargs') – returns the query parameters when the application was launched from another application Since version: 2.3

  • ClientOSEnvGet ('device_udf|getpushid') – returns the device ID, which can be used for sending push notifications to the device Since version: 2.4c

  • ClientOSEnvGet ('device_udf|my_string') – calls a user defined function as detailed in the Using Native OS Code in Mobile Applications topic Since version: 2.2a

  • ClientOSEnvGet('device_resource-folder') – returns the value of the resource folder as detailed in the Alternative Images section Since version: 2.3

On Android devices, you can also use Java predefined keys (for example: ClientOSEnvGet ('java.io.tmpdir')) to get additional information. For more information, refer to:

http://developer.android.com/reference/java/lang/System.html#getProperty(java.lang.String)

Related topics

Reference
Attachment 
Attachment