weimingtom / python-for-android

Automatically exported from code.google.com/p/python-for-android
Apache License 2.0
1 stars 0 forks source link

HTC Desire+ cyanogen (android 2.3) errors #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
this script:

import android 
droid = android.Android(('10.0.0.100', 36868))
print droid.batteryGetLevel()

generate :
Result(id=0, result=None, error=None)

the same with all the sensors and battery funtions, camera funtion crash....

Original issue reported on code.google.com by emubo...@gmail.com on 26 May 2011 at 1:40

GoogleCodeExporter commented 9 years ago
Same on Click (HTC Tattoo), only tested the battery status.

Original comment by marc.sch...@gmail.com on 2 Jun 2011 at 10:10

GoogleCodeExporter commented 9 years ago
Try monitoring your battery prior to getting it's stats:

In [63]: droid.batteryStartMonitoring()
Out[63]: Result(id=2224, result=100, error=None)

In [64]: droid.batteryGetLevel()
Out[64]: Result(id=2225, result=100, error=None)

In [65]: droid.batteryGetLevel()
Out[65]: Result(id=2226, result=None, error=None)

In [66]: droid.batteryGetLevel()
Out[66]: Result(id=2227, result=100, error=None)

In [67]: droid.readBatteryData()
Out[67]: Result(id=2228, result=100, error=None)

In [68]: droid.readBatteryData()
Out[68]: Result(id=2229, result=100, error=None)

In [69]: droid.batteryStopMonitoring()
Out[69]: Result(id=2230, result={u'status': 2, u'temperature': 270, u'level': 
100, u'battery_present': True, u'plugged': 2, u'health': 2, u'voltage': 4200, 
u'technology': u'Li-poly'}, error=None)

Original comment by Jennifer...@gmail.com on 29 Jun 2011 at 10:21

GoogleCodeExporter commented 9 years ago
In this case the monitoring does not work like above:

>>> droid.batteryStartMonitoring()
Result(id=0, result=None, error=None)
>>> droid.batteryGetLevel()
Result(id=1, result=100, error=None)
>>> droid.batteryStopMonitoring()
Result(id=5, result=None, error=None)

Original comment by marc.sch...@gmail.com on 29 Jun 2011 at 10:45

GoogleCodeExporter commented 9 years ago
Try to do this:

import android
droid = android.Android()

print droid.sensorsReadAccelerometer()

It returns:
java.lang.NullPointerException
Result(id=1, result=None, error=u'java.lang.NullPointerException')

___

HTC WildFire

Original comment by vlad.maz...@gmail.com on 9 Jul 2011 at 2:54

GoogleCodeExporter commented 9 years ago
This is an sl4a issue.
See http://code.google.com/p/android-scripting/

Original comment by rjmatthews62 on 3 Apr 2012 at 2:16