Android Question How can I access the fields of a sensor objectes

monki

Active Member
Licensed User
Longtime User
I have a list of sensor object and want to access with the Java objet on the individual fields kan someone help me .?
 

monki

Active Member
Licensed User
Longtime User
Hello eurojam ,
your link will not help .
Contains the list of objects installed sensors in the device . I want details like vendor , name , resolution , etc.
 
Upvote 0

monki

Active Member
Licensed User
Longtime User
@NJDude

the following code with the lib. fails

B4X:
Sub test
Dim p As Phone Sensor Extra
p.Initialize ( p.TYPE_LIGHT )
Dim l As List = p.getAllSensors
End Sub



java.lang.NullPointerException
at com.genesis.extendedsensors.PhoneSensorsExtra.getAllSensors ( PhoneSensorsExtra.java:125 )
 
Upvote 0

monki

Active Member
Licensed User
Longtime User
@eurojam
The Device list for precisely this code of Johan produced but unfortunately it does not show how to access the details
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
@NJDude

the following code with the lib. fails

B4X:
Sub test
Dim p As Phone Sensor Extra
p.Initialize ( p.TYPE_LIGHT )
Dim l As List = p.getAllSensors
End Sub



java.lang.NullPointerException
at com.genesis.extendedsensors.PhoneSensorsExtra.getAllSensors ( PhoneSensorsExtra.java:125 )
You have to do it like this:
B4X:
Private sensor As PhoneSensorsExtra
Private sensorList As List

sensor.StartListening("sensor")
sensorList = sensor.getAllSensors

...
Then parse every entry on that list.
 
Upvote 0
Top