2016-08-02 5 views
0

Ich weiß, dass die Cordova device plugin ich mit Informationen wie Plattform zugreifen kann, Modell, Hersteller usw.Ersten Geräteinformationen mit Cordova

Ist es möglich, unter Verwendung von Cordova oder etwas kompatibel Informationen wie die Geräte Speicherkapazität oder RAM-Nutzungsstatistiken zu erhalten ? Ich würde das für IOS, Android, Windows und Blackberry suchen.

+0

https://StackOverflow.com/Questions/11604929/Phonegap-display-available-free-space – Phonolog

Antwort

1

Cordova device plugin definiert ein globales Geräteobjekt, das die Hardware und Software des Geräts beschreibt. Obwohl das Objekt im globalen Gültigkeitsbereich liegt, ist es erst nach dem Wartungsvorgang verfügbar.

document.addEventListener("deviceready", onDeviceReady, false); 
    function onDeviceReady() { 
     // Android: Nexus One  returns "Passion" (Nexus One code name) 
//    Motorola Droid returns "voles" 
// BlackBerry: Torch 9800  returns "9800" 
// Browser: Google Chrome returns "Chrome" 
//    Safari   returns "Safari" 
// iOS:  for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models 
// OSX:      returns "x86_64" 
// 
var model = device.model; 
     // Depending on the device, a few examples are: 
// - "Android" 
// - "BlackBerry 10" 
// - "browser" 
// - "iOS" 
// - "WinCE" 
// - "Tizen" 
// - "Mac OS X" 
var devicePlatform = device.platform; 
    } 

Bitte lesen Sie die Dokumentation sorgfältig, es hat alle Informationen darin angegeben.

Verwandte Themen