Initial Move of the Javascript OUT of the shared directory: Android

This commit is contained in:
Joe Bowser
2009-11-17 10:38:49 -08:00
parent 1731eeca69
commit d012235bc2
95 changed files with 2467 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
/**
* 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();
} else {
this.platform = DeviceInfo.platform;
this.version = DeviceInfo.version;
this.name = DeviceInfo.name;
this.gap = DeviceInfo.gap;
this.uuid = DeviceInfo.uuid;
}
} catch(e) {
this.available = false;
}
}
PhoneGap.addConstructor(function() {
navigator.device = window.device = new Device();
var event = document.createEvent("Events");
event.initEvent('deviceReady', false, false);
document.dispatchEvent(event);
});