damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.43k stars 800 forks source link

About SL4A API #57

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:31

I run this Program:

import android
droid=android.Android()
name=droid.batteryGetHealth()
print name
print name.result

The results are:

Result(id=1, result=None, error=None)
None

I see batteryGetHealth() from API

Returns the most recently received battery health data:
1 - unknown;
2 - good;
3 - overheat;
4 - dead;
5 - over voltage;
6 - unspecified failure;

Displayed clearly wrong.

Similarly, I changed the name = droid.getPackageName ("com.abc.a") return is on 
top of those results, Which know how this is going?

Original issue reported on code.google.com by pis...@gmail.com on 29 Sep 2012 at 6:04

Copied from original issue: damonkohler/android-scripting#662

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:31

Same on sprint galaxy note 2, android 4.1.1, SL4A 6:

In [40]: android.checkScreenOn()
Out[40]: Result(id=35, result=False, error=None) # many calls work

In [41]: android.batteryGetHealth()
Out[41]: Result(id=36, result=None, error=None) # battery ones don't

Original comment by drewpca on 16 Dec 2012 at 7:06