(MRWD) Sensors Lesson

Sensors
Sensors are used to gather real world data around us and turn that into useful information. Mobile devices have sensors that measure motion, orientation, and various environmental conditions. For instance, games might track a user's gestures and motions, such as tilt, shake, rotation or swing. Other apps use sensory data such as temperature and steps taken. Travel apps might use geomagnetic field sensor and accelerometer to report compass directions or locations.
Most phone have the following sensors:
- Accelerometer
- Gyroscope
- Digital Compass
- Ambient Light Sensor
- Proximity Sensor
- Temperature Sensor
- Sound
- Pedometer
- Fingerprint Sensors
- Heart Rate Monitors
- Barometer
- IR Blaster Sensor
Explore each section in the tabs below to learn more.
Accelerometer Sensor
This component can determine if the phone is shaking and if it's being held upright or upside-down. This capability is very useful when you want the screen to re-orient in response to how the phone is being held, or if you want the app to react to shaking.
Pedometer
This sensor uses the accelerometer sensor to measure how many steps the user holding the phone takes, and can also estimate distance travelled.
Gyroscope
This component can sense if the phone is being tilted. It is more precise than the accelerometer and can measure how much the orientation of the phone has changed.
Clock
This allows your app to get the current time or use a timer. This component can be useful for setting a timed alarm, using a timer or knowing when it is daytime or nighttime.
Location Sensor
This sensor collects the latitude and longitude of the phone's location. This sensor can be useful anytime you need search for businesses or points of interests near the user.
Proximity Sensor
This sensor can tell if the phone is being held up to a person's face or not. However, not all phones can support this capability.
Some of the sensors do not work with the emulator. You need to export the app to an Android device to properly use the sensor features.
[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION