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

Discussion in 'Android Questions' started by monki, Aug 10, 2015.

  1. monki

    monki Active Member Licensed User

    I have a list of sensor object and want to access with the Java objet on the individual fields kan someone help me .?
     
  2. eurojam

    eurojam Well-Known Member Licensed User

  3. monki

    monki Active Member Licensed 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.
     
  4. NJDude

    NJDude Expert Licensed User

    Check THIS library.
     
  5. monki

    monki Active Member Licensed User

    @NJDude

    the following code with the lib. fails

    Code:
    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 )
     
  6. eurojam

    eurojam Well-Known Member Licensed User

  7. monki

    monki Active Member Licensed User

    @eurojam
    The Device list for precisely this code of Johan produced but unfortunately it does not show how to access the details
     
  8. NJDude

    NJDude Expert Licensed User

    You have to do it like this:
    Code:
    Private sensor As PhoneSensorsExtra
    Private sensorList As List

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

    ...
    Then parse every entry on that list.
     
    Rick Harris and lemonisdead like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice