There are four Java classes related to the use of sensors on the Android platform. List them and explain the purpose of each.

Asked 21-Jan-2018
Viewed 1499 times

1

There are four Java classes related to the use of sensors on the Android platform. List them and explain the purpose of each.


1 Answer


0

the four java classes related to the use of sensors on the android are -

  1. Sensor: this class is used to identify the sensor capability available to the user. it will help you create the instance of a specific sensor which a user wants to implement.  It contains the various methods and constants which can be used to interact with the various hardware or software related sensors available to the user.
  2. SensorManager: this class will help you to access the various sensors. you can access them the various methods provided by this class. it is to be noted that when using sensor it should be disabled when not in use. by overlooking these things it will cause the drainage of the battery very fast.
  3.  SensorEvent: this class provides various sensor information such as sensors raw data. it holds the data provided by the sensor.  this API uses the phones coordination axis to interact with the sensor.
  4. SensorEventListener: this interface is used to access the information provided when the event occurs or the sensor provides new data.