groupe-sii / cordova-plugin-device-display-metrics

Cordova plugin providing access to display metrics : density, etc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cordova Plugin Device Display Metrics

Simple plugin that returns the device display metrics: dpi, etc.

Using

Create a new Cordova Project

$ cordova create hello com.example.helloapp Hello

Install the plugin

$ cd hello
$ cordova plugin add com.groupe-sii.device-display-metrics

Call the APIs in your project

var success = function(metrics) {
    console.log(metrics);
}

var failure = function() {
    alert('Error calling DeviceDisplayMetrics Plugin');
}

document.addEventListener('deviceready', onDeviceReady);

function onDeviceReady() {
    deviceMetrics.getDpi('', success, failure);
}    

Install iOS and/or Android platform

cordova platform add ios
cordova platform add android

Run the code

cordova run

More Info

For more information on setting up Cordova see the documentation

For more info on plugins see the Plugin Development Guide

About

Cordova plugin providing access to display metrics : density, etc


Languages

Language:Objective-C 89.5%Language:Java 8.3%Language:JavaScript 2.2%