2016-08-02 81 views
0

我知道使用Cordova device plugin我可以訪問信息,如平臺,型號,生產廠家等獲取使用科爾多瓦

使用科爾多瓦或兼容的東西拿到像設備的存儲容量或內存使用率統計信息是有可能的設備信息?我會在iOS,Android,Windows和Blackberry上看這個。

+0

https://stackoverflow.com/questions/11604929/phonegap-display-available-free-space – Phonolog

回答

1

Cordova device plugin定義了一個全局設備對象,它描述了設備的硬件和軟件。儘管該對象位於全局範圍內,但在deviceready事件之後纔可用。

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; 
    } 

請仔細閱讀文檔,它已經給出了所有的信息。