This topic describes the JavaScript APIs of WVSystem. You can refer to this topic when you create HTML5 apps or Miniapps. The JavaScript APIs of WVSystem provide the capabilities to obtain system information and battery information.
WVSystem.getSystemInfo
This API is available only in WindVane Android 1.0.3.4 or later, WindVane iOS 2.1.4 or later.
Obtains the system information of a device.
Input parameters
No input parameters exist.
Callback parameters
Parameters for the success callback:
[
string]model: the device model.[
string]brand: the brand of the device.[
string]platform: the platform of the device, which can be Android or iOS.[
string]system: the system version.[
string]screenWidth: the screen width.[
string]screenHeight: the screen height.[
string]density: the screen density.[
string]dpi: the dots per inch (DPI) of the screen.[
string]appLanguage: the current language of the app.[
string]systemLanguage: the current language of the system.[
string]currentBattery: the current battery percentage.[
string]storage: the disk capacity. Unit: MB. If you do not have theREAD_EXTERNAL_STORAGEpermission on Android, 0 MB is returned.
Parameters for the failure callback:
[
string]msg: the error message.
window.WindVane.call('WVSystem', 'getSystemInfo', {}, function(e) {
alert('success: ' + JSON.stringify(e));
}, function(e) {
alert('failure: ' + JSON.stringify(e));
});WVSystem.getSystemInfoSync
This API is available only in WindVane Android 1.0.3.4 or later.
Synchronously obtains the system information of a device.
Input parameters
No input parameters exist.
Callback parameters
Parameters for the success callback:
[
string]model: the device model.[
string]brand: the brand of the device.[
string]platform: the platform of the device, which can be Android or iOS.[
string]system: the system version.[
string]screenWidth: the screen width.[
string]screenHeight: the screen height.[
string]density: the screen density.[
string]dpi: the DPI of the screen.[
string]appLanguage: the current language of the app.[
string]systemLanguage: the current language of the system.[
string]currentBattery: the current battery percentage.[
string]storage: the disk capacity. Unit: MB. If you do not have theREAD_EXTERNAL_STORAGEpermission on Android, 0 MB is returned.
Parameters for the failure callback:
[
string]msg: the error message.
window.WindVane.call('WVSystem', 'getSystemInfoSync', {}, function(e) {
alert('success: ' + JSON.stringify(e));
}, function(e) {
alert('failure: ' + JSON.stringify(e));
});