Home Web Front-end H5 Tutorial How to use phonegap to obtain device information

How to use phonegap to obtain device information

Aug 08, 2017 pm 04:41 PM
Obtain equipment

The following editor will bring you some methods of using phonegap to obtain device information. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look.

device.name The name of the device

device.phonegap phonegap version

device.platform Type of device

##device.uuid Device unique identification number

device.version Version of the operating system 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(&#39;props&#39;);   
                myp.innerHTML = &#39;Device Name: &#39; + device.name + &#39;<br />&#39; +   
                    &#39;Device PhoneGap: &#39; + device.phonegap + &#39;<br />&#39; +   
                    &#39;Device Platform: &#39; + device.platform + &#39;<br />&#39; +   
                    &#39;Device UUID: &#39; + device.uuid + &#39;<br />&#39; +   
                    &#39;Device Version: &#39; + device.version + &#39;<br />&#39;  
    
            }   
        </script>   
    </head>   
    
    <body onload="onLoad()">   
        <p id="props"> Loading device properties...</p>   
    </body>   
    
</html>
Copy after login

The above is the detailed content of How to use phonegap to obtain device information. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
Error code 801c03ed: How to fix it on Windows 11 Error code 801c03ed: How to fix it on Windows 11 Oct 04, 2023 pm 06:05 PM

Error 801c03ed is usually accompanied by the following message: Administrator policy does not allow this user to join the device. This error message will prevent you from installing Windows and joining a network, thereby preventing you from using your computer, so it is important to resolve this issue as soon as possible. What is error code 801c03ed? This is a Windows installation error that occurs due to the following reason: Azure setup does not allow new users to join. Device objects are not enabled on Azure. Hardware hash failure in Azure panel. How to fix error code 03c11ed on Windows 801? 1. Check Intune settings Log in to Azure portal. Navigate to Devices and select Device Settings. Change "Users can

8 Ways to Reinstall Safari on iPhone 8 Ways to Reinstall Safari on iPhone Sep 16, 2023 am 11:17 AM

Web browsing is an essential function of mobile devices, and browsers facilitate it effectively. These browsers also support the installation of content blockers and other tools to personalize your browsing experience. Apple's iOS platform uses Safari as its default browser. In rare cases, you may find that Safari browser is missing from your device. If you encounter this situation, the following steps will guide you on how to restore it. Can you reinstall Safari on iPhone? Safari is a built-in application on iOS devices and cannot be deleted or uninstalled due to its protected system status. If the app seems to be missing from your device, you may be dealing with an error, or the app may be hidden for various reasons.

How to get file extension in Python? How to get file extension in Python? Sep 08, 2023 pm 01:53 PM

A file extension in Python is a suffix appended to the end of a file name to indicate the format or type of the file. It usually consists of three or four characters, a file name followed by a period, such as ".txt" or ".py". Operating systems and programs use file extensions to determine what type of file it is and how it should be processed. Recognized as a plain text file. File extensions in Python are crucial when reading or writing files because it establishes the file format and the best way to read and write data. For example, the ".csv" file extension is the extension used when reading CSV files, and the csv module is used to process the files. Algorithm for obtaining file extension in Python. Manipulate file name string in Python.

How to re-enable cellular options on Windows 11 How to re-enable cellular options on Windows 11 Sep 18, 2023 am 10:29 AM

The laptop's cellular capabilities generally work fine, and users can insert a SIM card or use an eSIM. But recently, some people have reported that the cellular option is missing in Windows 11. Regardless of whether they restart the PC or unplug and reinsert the SIM card, the cellular option does not appear in Windows 11. Keep in mind that some Windows 10 users are also facing the same issue. Why don't my mobile network settings show up on Windows 11? Outdated, incompatible, corrupt or problematic drivers Cellular data network operators are facing issues Network adapter is disabled eSIM profile is not working or corrupt How to enable missing cellular option again on Windows 11? Before we start using a slightly complex

Where to get Google security code Where to get Google security code Mar 30, 2024 am 11:11 AM

Google Authenticator is a tool used to protect the security of user accounts, and its key is important information used to generate dynamic verification codes. If you forget the key of Google Authenticator and can only verify it through the security code, then the editor of this website will bring you a detailed introduction on where to get the Google security code. I hope it can help you. If you want to know more Users please continue reading below! First open the phone settings and enter the settings page. Scroll down the page and find Google. Go to the Google page and click on Google Account. Enter the account page and click View under the verification code. Enter your password or use your fingerprint to verify your identity. Obtain a Google security code and use the security code to verify your Google identity.

Please update your device settings to accept media transfers Please update your device settings to accept media transfers Feb 19, 2024 pm 12:24 PM

We will show you how to fix media transfer error when connecting your phone to PC via USB cable. When you try to import photos and videos from your phone to your computer, you may encounter a "Please update your device's settings to accept media transfers" error message displayed by the Photos app. Please update your device settings to accept media transfers Update your device settings to allow media transfers to resolve the error message. Restart your two devices Use different USB cables Check your Android phone settings Install the MTP USB device driver Use other methods to transfer your photos and videos Let’s get started. 1] Restart both devices It is recommended that you first try to restart your devices, including computers and phones, when you encounter a temporary failure. Heavy

What should I do if there is no sound in the system after win11 update? How to solve the problem of no sound in win11 device What should I do if there is no sound in the system after win11 update? How to solve the problem of no sound in win11 device Jun 25, 2024 pm 05:19 PM

After some users have updated and upgraded the win11 system, the computer has no sound. The problem of loving you is usually caused by no device, missing sound card driver, or unknown error. So how should we solve these problems? , this issue of win11 tutorial is here to answer everyone’s questions. Next, let’s take a look at the detailed steps. Solution to no sound after win11 upgrade: 1. No device 1. If we are using a desktop computer, it is probably because there is no device. 2. Because ordinary desktop computers do not come with built-in speakers, we need to plug in speakers or headphones to have sound. 2. The sound card driver is missing 1. After we update the Win11 system, the original sound card or audio device driver may not be available.

How to send files and photos using AirDrop proximity sharing: What's new in iOS 17 How to send files and photos using AirDrop proximity sharing: What's new in iOS 17 Sep 16, 2023 am 10:17 AM

In iOS 17, Apple makes sharing files and media easier than ever, thanks to a cool new AirDrop proximity feature that does most of the work for you. In previous versions of iOS, transferring files or photos between Apple devices involved opening the relevant file, tapping the Share button, selecting AirDrop, and then selecting the nearby device to which you wanted to send the file. In iOS17 and iPadOS17, this process still exists for sharing between Apple devices, but if you're transferring between iPhones or iPads, you can use AirDrop's new proximity sensing feature to eliminate some of the typical sharing steps. To initiate a transfer, select the

See all articles