In this post we will take a look on fetching device information in Icenium. Internally Icenium usage PhoneGap to build the application. We will use PhoneGap API to fetch device information. It is always good idea to read device information when device is being ready. Device information can be fetched with reading values of following properties.
So in Icenium device information on device ready can be read as given in below code snippet,
document.addEventListener("deviceready", onDeviceReady, false); // PhoneGap is ready function onDeviceReady() { var deviceName = device.name; var deviceId = device.uuid; var deviceOs = device.platform; var deviceOsVersion = device.version; //Use device information as required console.log("devicename : " + deviceName + " deviceId: " + deviceId + " deviceOs: " + deviceOs + " deviceosversion : " + deviceOsVersion); }
On running application in Graphite simulator you will find device information.
In this way device information can be fetched in Icenium. I hope you find this post useful. Thanks for reading.
Nice post!
It would have been perfect if you had added what permission might be needed to retrieve device information: http://docs.phonegap.com/en/1.8.1/cordova_device_device.md.html