SENSORS IN ANDROID
#Overview of Sensors
The sensor is used for to monitor the three-dimensional device movement or any change in device environment. Those are measured the device motion, device orientation and different types of environmental conditions.
A sensor is supposed to provide the high accuracy & clarity to provide the raw data.
Ex.
- The game application uses the device gravity sensor for tracking the readings.
- Weather application might use device’s temperature sensor and humidity sensor for calculation of report for dew point.
- Travel app might use the geomagnetic field of the sensor.
- Accelerometer sensor may use for compass bearing.
There are Three main categories of the sensor in android.
- Motion sensors
- Environmental sensors
- Position sensors
The explanation as per below:
A. Motion sensors
Motion Sensor is used to measure the acceleration forces and rotational forces along with three access. In this motion, the category includes the following type of sensors.
i)Accelerometer Sensors
ii)Gravity Sensors
iii)Gyroscopes,
iv)Rotational vector sensors.
B.Environmental sensors
Environmental sensors measure the different types of environmental parameters such as air temperature and pressure, illumination, and humidity. In this category include following a type of sensor.
i)Barometers
ii)Photometers
iii)Thermometers.
C.Position sensors
Position sensors measure the physical position of the device. In this category include following type of sensor.
i) Orientation Sensor
ii) Magnetometers
#Explanation of Motion sensor in Android.
- ACCELEROMETER
Type: Hardware
Description: It used for measure the acceleration force in m/s2 which is applied to a device, on three physical axes (x,y & z) including the force gravity.
Use: Motion Detection (shake, tilt etc.)
- GRAVITY
Type: Software/Hardware
Description: It used for measure the force of gravity, in m/s2 which is applied on The device on three physical axes (x,y& z).
Use: Motion Detection (shake, tilt etc.)
- GYROSCOPES
Type: Hardware
Description: Measure the device rate of rotation in rad/s around the each of three physical axes(x,y & z). Allow the device rotation from portrait to landscape & vice versa.
Use: Rotation Detection (spin, turn etc.)
- ROTATIONAL VECTOR SENSOR
Description: The rotational sensor is virtual sensors. It is represented from API level 9. Which collect the data from different types oss sensors usually it is used from ( ACCELEROMETER, GEOMAGNETIC_FIELD, and GYROSCOPE), it’s doing a smart calculation on this collected data & provide the more accurate result as rather than raw data of ACCELEROMETER, GEOMAGNETIC_FIELD and GYROSCOPE sensors.
#Explanation of Environmental sensor in Android.
- BAROMETERS
Description: It is used in metrology to measure the atmospheric pressure.it also measure the pressure exerted by the atmosphere. This measurement used to forecast small term changes in weather.
Ex. Weather forecasting
# Explanation Of Position sensors
- Orientation Sensor
Type: Software
Description: It used for measure the degree of rotation that a device makes around all three physical axes (x, y, z)
Use: For detecting the device position.
7. Magnetometers
Description: Create a miniature Hall-effect sensor that detects the Earth’s magnetic field along three perpendicular axes X, Y, and Z. The Hall-effect sensor produces voltage which is proportional to the strength and polarity of the magnetic field along the axis each sensor is directed.
Sensed voltage is converted to the digital signal representing the magnetic field intensity.