Cordova Device - Cordova

What is Cordova Device?

This plugin is used for getting information about users device.

Step 1 - Installing Device Plugin

To install this plugin, we need to run the following snippet in command prompt.

Step 2 - Adding Button

We will be using this plugin the same way we used the other Cordova plugins. Let's add button in index.html file. This button will be used for getting info obout device.

Step 3 - Adding Event Listener

Cordova plugins are available after the deviceready event so we will place event listener inside onDeviceReady function in index.js.

Step 4 - Creating Function

The function below will show how to use all possibilities the plugin provides. We will place it in index.js.

When we click CORDOVA DEVICE button, the alert will present us Cordova version, device model, platform, UUID and device version.

Cordova - Device

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Cordova Topics