M monki Active Member Licensed User Longtime User Aug 10, 2015 #1 I have a list of sensor object and want to access with the Java objet on the individual fields kan someone help me .?
I have a list of sensor object and want to access with the Java objet on the individual fields kan someone help me .?
eurojam Well-Known Member Licensed User Longtime User Aug 10, 2015 #2 did you try to do it with pure B4A: https://www.b4x.com/android/help/phone.html#phonesensors Upvote 0
M monki Active Member Licensed User Longtime User Aug 10, 2015 #3 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
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.
M monki Active Member Licensed User Longtime User Aug 10, 2015 #5 @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
@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 )
eurojam Well-Known Member Licensed User Longtime User Aug 10, 2015 #6 or try this pretty good example, there you get all the information .... https://www.b4x.com/android/forum/threads/device-sensors.50674/ Upvote 0
or try this pretty good example, there you get all the information .... https://www.b4x.com/android/forum/threads/device-sensors.50674/
M monki Active Member Licensed User Longtime User Aug 10, 2015 #7 @eurojam The Device list for precisely this code of Johan produced but unfortunately it does not show how to access the details Upvote 0
@eurojam The Device list for precisely this code of Johan produced but unfortunately it does not show how to access the details
NJDude Expert Licensed User Longtime User Aug 10, 2015 #8 monki said: @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 ) Click to expand... 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
monki said: @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 ) Click to expand... 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.