本文介紹系統資訊類WVSystem相關的JSAPI,供您建立H5端應用或者小程式時參考。系統資訊類WVSystem相關JSAPI提供系統資訊擷取、電量擷取等能力。
WVSystem.getSystemInfo
該API只在Windvane Android 1.0.3.4以上版本有效。
擷取手機系統資訊。
輸入參數
無輸入參數。
回調參數
成功回調參數:
[
string]model:裝置的手機型號。[
string]brand:裝置的品牌。[
string]platform:平台,Android或iOS。[
string]system:系統版本。[
string]screenWidth:螢幕寬度。[
string]screenHeight:螢幕高度。[
string]density:螢幕密度。[
string]dpi:裝置像素比。[
string]appLanguage:App當前的語言。[
string]systemLanguage:系統當前的語言。[
string]currentBattery:當前電量。[
string]storage:磁碟容量,單位為MB。Android系統上如果沒有READ_EXTERNAL_STORAGE許可權,會返回0MB。
失敗回調參數:
[
string]msg:錯誤訊息。
window.WindVane.call('WVSystem', 'getSystemInfo', {}, function(e) {
alert('success: ' + JSON.stringify(e));
}, function(e) {
alert('failure: ' + JSON.stringify(e));
});WVSystem.getSystemInfoSync
該API只在Windvane Android 1.0.3.4以上版本有效
擷取手機系統資訊,同步執行。
輸入參數
無輸入參數。
回調參數
成功回調參數:
[
string]model:裝置的手機型號。[
string]brand:裝置的品牌。[
string]platform:平台,Android或iOS。[
string]system:系統版本。[
string]screenWidth:螢幕寬度。[
string]screenHeight:螢幕高度。[
string]density:螢幕密度。[
string]dpi:裝置像素比。[
string]appLanguage:App當前的語言。[
string]systemLanguage:系統當前的語言。[
string]currentBattery:當前電量。[
string]storage:磁碟容量,單位為MB。Android系統上如果沒有READ_EXTERNAL_STORAGE許可權,會返回0MB。
失敗回調參數:
[
string]msg:錯誤訊息。
window.WindVane.call('WVSystem', 'getSystemInfoSync', {}, function(e) {
alert('success: ' + JSON.stringify(e));
}, function(e) {
alert('failure: ' + JSON.stringify(e));
});