Overview
The Device Module controls device functions.
Syntax
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"); |
Methods
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 |
Multi Instance
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.
Remarks
Interaction with Unattended Method of the Push Module
The Suspend functionality is incompatible with the unattended functionality of the push module and they should not be used together.
wake Method
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.
Requirements
RhoElements Version | 1.0.0 or above |
---|---|
Supported Devices | All supported devices. |
Minimum Requirements | None. |
Persistence | Immediate - These methods are actioned immediately. |
HTML/JavaScript Examples
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">