The Device Module controls device functions.
device (Module) <META> Syntax |
---|
<META HTTP-Equiv="Device" content="[method]"> |
Device JavaScript Object Syntax: |
---|
By default the JavaScript Object 'device' will exist on the current page and can be used to interact directly with the device. |
To Invoke device methods via JavaScript use the following syntax: device.method(); e.g. device.suspend(); |
To set multiple EMML parameters / events on a single line use the following syntax: device.setEMML("[Your EMML Tags]"); e.g. device.setEMML("suspend"); |
Device Ruby Object Syntax: |
---|
By default the Ruby Object 'Device' will exist on the current page and can be used to interact directly with the Device. All Methods, Parameters and Events are the same as JavaScript, however, notice 'Device' needs to start with an uppercase letter. Another difference in Ruby is that methods do not end in '()' |
To Invoke Device methods via Ruby use the following syntax: Device.method() e.g. Device.suspend |
Items listed in this section indicate methods or, in some cases, indicate parameters which will be retrieved.
Name | Description | Default Value |
---|---|---|
suspend | puts the device into suspend mode | Not in suspend mode |
powerOff | puts the device into power off mode. In this mode the device will draw no power. Only supported on SB1. | Not in Power Off mode |
wake | Wakes the device from suspend mode | wake mode |
calibrate | Carries out the screen calibration routine | Not calibrating |
When multiple RhoElememts applications are running the following considerations should be made: Only the application with Focus will have the ability to control device functions.
The Suspend functionality is incompatible with the unattended functionality of the push module and they should not be used together.
The wake functionality can be used along with Push module. For eg: in the push detected event the user can call the wake method to wake the device. Please note that the Enterprise Tablet opens in Lock Screen mode if wake method is used and the screen stays active until the user swicthes it off and hence this method consumes more battery power.
RhoElements Version | 1.0.0 or above |
---|---|
Supported Devices | All supported devices except Enterprise Tablet. Only the method "wake" is supported on the Enterprise Tablet. |
Minimum Requirements | None. |
Persistence | Immediate - These methods are actioned immediately. |
The following example put the device into suspend mode:
<META HTTP-Equiv="Device" Content="Suspend">
The following example wakes the device from Suspend mode:
<META HTTP-Equiv="Device" Content="wake">