DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


built_in:get_battery_level

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

built_in:get_battery_level [2016/05/27 22:14]
196.97.57.178 created
built_in:get_battery_level [2016/10/28 11:38] (current)
titus
Line 1: Line 1:
-Returns the current battery level of your device as a number between 0 and 10+Returns the current battery level of your device as a number between 0 and 1
  
 Example Example
Line 8: Line 8:
 var level = app.GetBatteryLevel() var level = app.GetBatteryLevel()
 //convert into percentage //convert into percentage
-var perlevel = level*10+"​%"​+var perlevel = level*100+"​%"​
 var text = "The current battery level is "​+perlevel var text = "The current battery level is "​+perlevel
 //Show through popup //Show through popup
built_in/get_battery_level.txt ยท Last modified: 2016/10/28 11:38 by titus