Android sensor Overview (1)

Source: Internet
Author: User
Tags event listener

This article translated from: http://developer.android.com/guide/topics/sensors/sensors_overview.html

Most Android devices have built-in sensors for measuring motion, direction, and various environmental conditions. These sensors provide raw data with high precision and accuracy that can be used to monitor the movement and position of a device in three dimensions, or to monitor changes in the environment around the device. For example, a game may have to read tracks from Gravity Sensors to deduce complex user gestures and intentions, such as skew, vibration, rotation, or swing. Similarly, weather applications may need to use device temperature sensors and humidity sensors to calculate and report dew points; travel applications may need to use the Geomagnetic sensor and accelerometer to report the orientation of the compass.

The Android platform supports three broad categories of sensors:

1. Motion sensor

These sensors measure acceleration and torque in three axes. This type of sensor includes an accelerometer, a gravity sensor, a gyroscope, and a selective vector sensor.

2. Environment Sensors

These sensors measure environmental parameters such as ambient air temperature and pressure, illuminance and humidity. This type of sensor includes a barometer, spectrophotometer, and a thermometer.

3. Position Sensor

These sensors are used to measure the physical location of a device. This type of sensor includes a direction sensor and a magnetic meter.

You can access valid sensors on these devices and obtain raw sensor data by using the android sensor framework. The sensor framework provides several classes and interfaces to help you perform various sensor-related tasks. For example, use a sensor to do the following:

1. Determine which sensors are available on the device;

2. Determine the capabilities of individual sensors, such as their maximum range, manufacturer, power demand, and recognition rate;

3. Obtain the original sensor data and define the minimum ratio for obtaining the sensor data;

4. Register and unregister the event listener to monitor sensor changes.

This article provides an overview of available sensors on the Android platform, as well as an introduction to the sensor framework. For details, refer to subsequent articles.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.