-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusage_sample.html
More file actions
executable file
·44 lines (32 loc) · 1.6 KB
/
usage_sample.html
File metadata and controls
executable file
·44 lines (32 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<title>Device Properties Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
<script type="text/javascript" charset="utf-8" src="NSBundleFileEngine.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for PhoneGap to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap is ready
//
function onDeviceReady() {
//alert('on device ready');
var NSBundleFileEngine = window.plugins.nsbundle;
//initially the host_url has http://googel.com as value.
var plistObj = {key:"host_url",value:"http://github.com"};
NSBundleFileEngine.writeToPlistFileWithValues(plistObj,function(res){console.log('write success : '+ res);},function(err){console.log('werr :' +err);});
NSBundleFileEngine.readPlistFile(['host_url'],function(res){console.log('success : '+ res);},function(err){console.log(err);});
var element = document.getElementById('deviceProperties');
element.innerHTML = 'Device Name: ' + device.name + '<br />' +
'Device PhoneGap: ' + device.phonegap + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Version: ' + device.version + '<br />';
}
</script>
</head>
<body>
<p id="deviceProperties">Loading device properties...</p>
</body>
</html>