The WVSystem JSAPIs retrieve device and system information, including screen dimensions, language settings, battery level, and storage capacity.
WVSystem.getSystemInfo
This API is available only in Windvane for Android 1.0.3.4 or later.
Retrieves system information from the device asynchronously.
Input parameters
None.
Callback parameters
The success callback returns the following parameters:
[
string] model: the device model.[
string] brand: the device brand.[
string] platform: the platform. Valid values:AndroidandiOS.[
string] system: the system version.[
string] screenWidth: the screen width.[
string] screenHeight: the screen height.[
string] density: the screen density.[
string] dpi: the device pixel ratio.[
string] appLanguage: the current language of the app.[
string] systemLanguage: the current language of the system.[
string] currentBattery: the current battery level.[
string] storage: the disk capacity, in MB. On Android, returns 0 MB if theREAD_EXTERNAL_STORAGEpermission is not granted.
The failure callback returns the following parameter:
[
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 for Android 1.0.3.4 or later.
Retrieves system information from the device synchronously.
Input parameters
None.
Callback parameters
The success callback returns the following parameters:
[
string] model: the device model.[
string] brand: the device brand.[
string] platform: the platform. Valid values:AndroidandiOS.[
string] system: the system version.[
string] screenWidth: the screen width.[
string] screenHeight: the screen height.[
string] density: the screen density.[
string] dpi: the device pixel ratio.[
string] appLanguage: the current language of the app.[
string] systemLanguage: the current language of the system.[
string] currentBattery: the current battery level.[
string] storage: the disk capacity, in MB. On Android, returns 0 MB if theREAD_EXTERNAL_STORAGEpermission is not granted.
The failure callback returns the following parameter:
[
string] msg: the error message.
window.WindVane.call('WVSystem', 'getSystemInfoSync', {}, function(e) {
alert('success: ' + JSON.stringify(e));
}, function(e) {
alert('failure: ' + JSON.stringify(e));
});