2009-11-18 02:38:49 +08:00
|
|
|
/**
|
|
|
|
* this represents the mobile device, and provides properties for inspecting the model, version, UUID of the
|
|
|
|
* phone, etc.
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
function Device() {
|
|
|
|
this.available = PhoneGap.available;
|
|
|
|
this.platform = null;
|
|
|
|
this.version = null;
|
|
|
|
this.name = null;
|
|
|
|
this.gap = null;
|
|
|
|
this.uuid = null;
|
|
|
|
try {
|
|
|
|
if (window.DroidGap) {
|
|
|
|
this.available = true;
|
|
|
|
this.uuid = window.DroidGap.getUuid();
|
|
|
|
this.version = window.DroidGap.getOSVersion();
|
|
|
|
this.gapVersion = window.DroidGap.getVersion();
|
|
|
|
this.platform = window.DroidGap.getPlatform();
|
|
|
|
this.name = window.DroidGap.getProductName();
|
2009-12-04 09:07:07 +08:00
|
|
|
}
|
2009-11-18 02:38:49 +08:00
|
|
|
} catch(e) {
|
|
|
|
this.available = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PhoneGap.addConstructor(function() {
|
|
|
|
navigator.device = window.device = new Device();
|
|
|
|
});
|