Salesforce

ClientOSEnvGet (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

ClientOSEnvGet (Magic xpa 4.x)

This Client-side function enables a developer to query for specific device capabilities and use it for conditional execution of logic.

Syntax:

ClientOSEnvGet(variable)

Parameters:

variable – A string value representing an operating system environment variable.

Returns:

An Alpha containing the value of the variable. If the variable is not set, an empty string is returned.

Example:

ClientOSEnvGet('PATH') reads the value of the operating system PATH environment variable.

Note:

  • This is a client-side function that is only available for Rich Client tasks. To use the server-side version of this function in Rich Client tasks, see OSEnvGet.

  • The function ClientOSEnvGet('device_magic-version') is now deprecated, you can use ClientGetAppInfo('app-magic-version') instead.

  • The function ClientOSEnvGet('temp') is now deprecated for mobile platforms. You can use ClientGetAppInfo('cacheFolder') instead.

Exceptions:

This function is not supported in Web Client tasks.

Platform specific:

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 (Since version: 2.3)
    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 (Since version: 2.3)
    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 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 (where xxx is the GPS timeout and yyy is the network timeout, Since version: 3.2a)

  • 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 – Android and iOS topic. 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)

See also:

The Rich Client Samples project (REL14b)

Reference
Attachment 
Attachment