This time I will bring you a detailed explanation of the method of obtaining device information with phonegap. What are the precautions for obtaining device information with phonegap? The following is a practical case, let’s take a look.
device.name The name of the device
device.phonegap phonegap version
device.platform Device type
device.uuid Device unique identification number
device.version The version of the operating system that is running
device is assigned to the window Object的
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>My Device</title> <script type="text/javascript" charset="UTF-8" src="cordova.js"></script> <script type="text/javascript" charset="UTF-8"> function onLoad() { document.addEventListener("deviceready", onDeviceReady, false); } function onDeviceReady() { var myp = document.getElementById('props'); myp.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 onload="onLoad()"> <p id="props"> Loading device properties...</p> </body> </html>
Detailed explanation of phonegap operation database
Detailed explanation of phonegap creation of contacts
The above is the detailed content of Detailed explanation of phonegap's method of obtaining device information. For more information, please follow other related articles on the PHP Chinese website!