Device

Obtains the device specific information, such as the device type, the device DPI/PPI, the OS version, the device's memory, the device's OS, the screen resolution, etc.

eon_mobile_deviceex object

Functions
of_getdeviceid

Description

Gets the device's unique identifier, which depends on the device manufacturer, product type, and operating system.

Supported on mobile client only.

Syntax

device.of_getdeviceid ( ref string as_id )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

string

as_id

Returns the device unique identifier.

Returns empty string if it is called in PowerBuilder or PowerServer Web or, if there is any error.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

Usage

Use the of_getdeviceid() function to allow the application to run on specific mobile devices that are authorized. In this way, if unauthorized users install the app on their own mobile device and somehow steals a valid username/password they still will not be able to run the app or your data.

of_getdevicetype

Description

Gets the device type from the manufacturer.

Supported on mobile client only.

Syntax

device.of_getdevicetype ( ref string as_type )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

string

as_type

Returns the device type; e.g., "iPod touch", "iPhone", "iPad", "GT-P5210", "Lenovo A3000-H" etc. The value of device type is set by the manufacturer.

Returns empty string if it is called in PowerBuilder or PowerServer Web or if there is any error.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getdpi

Description

Gets the device DPI value.

Supported on mobile client only.

Syntax

device.of_getdpi ( )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

Return value

Integer.

>0 - Return the device DPI value.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getppi

Description

Gets the device PPI value.

Supported on mobile client only.

Syntax

device.of_getppi ( )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

Return value

Integer.

>0 - Return the device PPI value.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_gettotalmemory

Description

Gets the total number (in KB) of the device memory.

Supported on mobile client only.

Syntax

device.of_gettotalmemory ( )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

Return value

Long.

>0 - Return the total number of the device memory.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getfreememory

Description

Gets the total number (in KB) of the available memory of the device.

Supported on mobile client only.

Syntax

device.of_getfreememory ( )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

Return value

Long.

>0 - Return the total number of the device free memory.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getname

Description

Gets the device's machine name.

Supported on mobile client only.

Syntax

device.of_getname ( ref string as_name )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

string

as_name

Returns the device's machine name.

Returns empty string if it is called in PowerBuilder or PowerServer Web, or if there is any error.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getorientation

Description

Detects if the device screen orientation is Landscape or Portrait.

Supported on mobile client only.

Syntax

device.of_getorientation ( )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

Return value

Integer.

0 - Unknown.

1 - Portrait, Home button at the bottom.

2 - Portrait, Home button on the top.

3 - Landscape, Home button to the right.

4 - Landscape, Home button to the left.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getplatform

Description

Gets the device's OS name.

Supported on mobile client only.

Syntax

device.of_getplatform ( ref string as_platform )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

string

as_platform

Returns the device's OS name; e.g., returns "iPhone OS" if the device is iPhone, iPad, or iPod touch, and returns "Android" if the device is Android tablets or smartphones. The value of OS name is obtained from the mobile device.

Returns empty string if it is called in PowerBuilder or PowerServer Web, or if there is any error.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getresolution

Description

Gets the device's resolution.

Supported on mobile client only.

Syntax

device.of_getresolution ( ref integer ai_height, ref integer ai_width )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

integer

ai_height

Returns the device's screen height (in pixels).

integer

ai_width

Returns the device's screen width (in pixels).

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getosversion

Description

Gets the OS version.

Supported on mobile client only.

Syntax

device.of_getosversion ( ref string as_version )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

string

as_version

Returns the device's OS version. For example, returns "6.0" if the iOS version is 6.0; returns "6.0.1" if the iOS version is 6.0.1. The value of OS version is obtained from the mobile device.

Returns empty string if it is called in PowerBuilder or PowerServer Web, or if there is any error.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getstatusbarvisible

Description

Detects if the system status bar is visible.

Supported on mobile client only.

Syntax

device.of_getstatusbarvisible ( )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

Return value

Integer.

1 - The system status bar is visible.

0 - The system status bar is invisible.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_setstatusbarvisible

Description

Sets whether the iOS system status bar is visible. This API takes no effect for the Android device and returns -1.

Supported on the iOS mobile client only.

Syntax

device.of_setstatusbarvisible ( value integer ai_mode )

Argument Type

Argument

Description

eon_mobile_deviceex

device

The name of the eon_mobile_deviceex object.

integer

ai_mode

1 - Sets the iOS system status bar to be visible.

0 - Sets the iOS system status bar to be invisible.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.