文档

系统信息

本文介绍系统信息类WVSystem相关的JSAPI,供您在通过跨平台DevOps创建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]language:系统当前的语言。

  • [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]language:系统当前的语言。

  • [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));
});
  • 本页导读 (0)
文档反馈