This library provides general Cordova functions such as
event handling and device information acquisition.
Record
Device is the metadata for the device.
- model String?
- The name of the model of the device or product. The value is set
by the device manufacturer and may be different across different versions
of the same product.
- Cordova String?
- The version of Cordova running on the device.
- platform String?
- The operating system name of the device.
- uuid String?
- The Universally Unique Identifier (UUID) of the device.
- version String?
- The operating system version of the device.
CordovaEvent is the event object that passes into a Cordova
event listener.
- name String
- The event name.
- data any
- The parameter for the event.
- Functions
- addEventListener (eventName String in, eventHandler CordovaEventHandler
in)
- Adds event listener for Cordova events.
- eventName
- The event to listen. The events supported are:
- EVENT_DEVICEREADY
- EVENT_PAUSE
- EVENT_RESUME
- EVENT_BACKBUTTON
- EVENT_MENUBUTTON
- EVENT_SEARCHBUTTON
- EVENT_STARTCALLBUTTON
- EVENT_ENDCALLBUTTON
- EVENT_VOLUMEDOWNBUTTON
- EVENT_VOLUMEUPBUTTON
- EVENT_BATTERYCRITICAL
- EVENT_BATTERYLOW
- EVENT_BATTERYSTATUS
- EVENT_ONLINE
- EVENT_OFFLINE
- eventHandler
- A callback function when the event is fired, with the CordovaEvent
object passed in.
- getDevice() returns (Device)
- Gets the running device’s information and returns a device
object.
- getConnectionType() returns (String)
- Gets the current network connection type and returns the connection
type.
- vibrate(ms int in)
- Vibrates the device.
- ms
- Determines the number of milliseconds to vibrate.
- vibrateWithPattern(mss int[] in)
- Vibrates the device with a given pattern.
- mss
- An array of milliseconds to indicate the on/off series to vibrate.