You are on page 1of 2

<!

DOCTYPE HTML>
<html>
<head>
<title>PhoneGap</title>
<script type="text/javascript" charset="utf-8" src="js/c
ordova.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEvenListener("deviceready", onDeviceReady, f
alse);
function onDeviceReady(){
var element= document.getElementById('deviceProperties')
;element.innerHTML =
'Device Name : ' + device.name + '<br/>'+
'Device cordova : ' + device.cordova + '<br/>'+
'Device platform : ' + device.platform + '<br/>' +
'Device uuid : ' + device.uuid + '<br/>' +
'Device Model : ' + device.model + '<br/>' +
'Device version : ' + device.version + '<br/>' ;
}</script>
</head>
<body>
<p id="deviceProperties"> Loading bro...</p>
</body>
document.getElementById("deviceName").innerHTML = device.name;
document.getElementById("version").innerHTML = device.phonegap;
document.getElementById("mobilePlatform").innerHTML = device.platform;
document.getElementById("platformVersion").innerHTML = device.version;
document.getElementById("uuid").innerHTML = device.uuid;
<h1>Device Info</h1>
<table border="1">
<tr>
<td>Device Name</td>
<td id="deviceName"></td>
</tr>
<tr>
<td>PhoneGap Version</td>
<td id="version"></td>
</tr>
<tr>
<td>Mobile Platform</td>
<td id="mobilePlatform"></td>
</tr>
<tr>
<td>Platform Version</td>
<td id="platformVersion"></td>
</tr>
<tr>
<td>UUID</td>
<td id="uuid"></td>
</tr>
</table>

function fetchNetworkConnectionInfo(){

var networkType = navigator.network.connection.type;

var networkTypes = {};

networkTypes[Connection.NONE] = 'No network connection';
networkTypes[Connection.UNKNOWN] = 'Unable to identify Network Connection Type'
;
networkTypes[Connection.CELL_2G] = 'Network Connection is of type 2G';
networkTypes[Connection.CELL_3G] = 'Network Connection is of type 3G';
networkTypes[Connection.CELL_4G] = 'Network Connection is of type 4G';
networkTypes[Connection.WIFI] = 'Network Connection is of type WiFi';
networkTypes[Connection.ETHERNET] = 'Network Connection is of type Ethernet';
document.getElementById("network-status").innerHTML = networkTypes[networkType]
;


}

You might also like