Device API
Original documentation: Cordova Device.
Remark: Usage of cordova API needs http://tizen.org/privilege/filesystem.read privilege.
Since: 3.0
Table of Contents
- 1. Interfaces
- 1.1. DeviceManagerObject
- 1.2. Device
- 2. Full WebIDL
Summary of Interfaces and Methods
Interface | Method |
---|---|
DeviceManagerObject | |
Device |
1. Interfaces
1.1. DeviceManagerObject
[NoInterfaceObject] interface DeviceManagerObject { readonly attribute Device device; };
Window implements DeviceManagerObject;
Since: 3.0
Privilege level: public
Privilege: http://tizen.org/privilege/filesystem.read
1.2. Device
[NoInterfaceObject] interface Device { readonly attribute DOMString cordova; readonly attribute DOMString model; readonly attribute DOMString platform; readonly attribute DOMString uuid; readonly attribute DOMString version; };
Since: 3.0
Privilege level: public
Privilege: http://tizen.org/privilege/filesystem.read
Attributes
-
readonly
DOMString cordovaReturns the version of Cordova running on the device.
Since: 3.0
Privilege level: public
Privilege: http://tizen.org/privilege/filesystem.read
Code example:
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log("Device Cordova: " + device.cordova); }
Output example:
Device Cordova: 5.1.1
-
readonly
DOMString modelGet the the name of the device's model or product. The value is set by the device manufacturer and may be different across versions of the same product.
Since: 3.0
Privilege level: public
Privilege: http://tizen.org/privilege/filesystem.read
Code example:
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log("Device Model: " + device.model); }
Output example:
Device Model: tm1
-
readonly
DOMString platformGet the device's operating system name.
Since: 3.0
Privilege level: public
Privilege: http://tizen.org/privilege/filesystem.read
Code example:
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log("Device Platform: " + device.platform); }
Output example:
Device Platform: Tizen
-
readonly
DOMString uuidGet the device's Universally Unique Identifier (UUID). The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model.
Since: 3.0
Privilege level: public
Privilege: http://tizen.org/privilege/filesystem.read
Code example:
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log("Device UUID: " + device.uuid); }
Output example:
Device UUID: 2LR1b3MXfEUSFvH04m4e1EXYvQA=
-
readonly
DOMString versionGet the operating system version.
Since: 3.0
Privilege level: public
Privilege: http://tizen.org/privilege/filesystem.read
Code example:
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log("Device Version: " + device.version); }
Output example:
Device Version: 3.0
2. Full WebIDL
module Device { Window implements DeviceManagerObject; [NoInterfaceObject] interface DeviceManagerObject { readonly attribute Device device; }; [NoInterfaceObject] interface Device { readonly attribute DOMString cordova; readonly attribute DOMString model; readonly attribute DOMString platform; readonly attribute DOMString uuid; readonly attribute DOMString version; }; };