I Have a problem with Cordova/Phonetgap Device API, the objetc device isn't found. I make callback to device.model or any fecture of device and return:
ReferenceError: Can't find variable: device at file:///android_asset/www/index.html:16
I'm following this steps: http://cordova.apache.org/docs/en/3.3.0/cordova_device_device.md.html#Device firts create the cordova android project and later I Install plugin device through: "cordova plugin add org.apache.cordova.device" I'm testing with this index.html:
<!DOCTYPE html>
<html>
<head>
<title>Device Properties Example</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// device APIs are available
//
function onDeviceReady() {
var string = device.platform;
var element = document.getElementById('deviceProperties');
element.innerHTML = string;
}
</script>
</head>
<body>
<p id="deviceProperties">Loading device properties...</p>
</body>
</html>
I have in app/res/xml/config.xml this lines:
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
Here There is a screenshot for more details: https://dl.dropboxusercontent.com/u/6404856/Helpme.JPG