Android sensor Overview (4)

Source: Internet
Author: User

Sensor availability

Sensor availability not only varies between different hardware, but also between different Android versions. This is because the introduction of Android sensors requires the release process on several platforms. For example, some sensors are introduced in android1.5 (API level 3), but some are not implemented until android2.3 (API level 9) is available. Similarly, some APIs in android2.3 (API level 9) and android4.0 (API
Level 14) introduced sensors, two of which have been discarded and replaced with newer and better sensors.

Table 2 outlines the availability of each sensor on each basic platform. Only four platforms are listed here, because they are platforms that involve sensor changes. The discarded sensors listed are still valid on subsequent platforms (on devices that provide the sensor). This is Android's backward compatibility policy.

Table 2. Sensor platform availability

Sensor

Android4.0

(API Level 14)

Andoroid2.3

(API level 9)

Android2.2

(API Level 8)

Android1.5

(API level 3)

TYPE_ACCELEROMETER

Yes

Yes

Yes

Yes

TYPE_AMBIENT_TEMPERATURE

Yes

N/

N/

N/

TYPE_GRAVITY

Yes

Yes

N/

N/

TYPE_GYROSCOPE

Yes

Yes

N/A1

N/A1

TYPE_LIGHT

Yes

Yes

Yes

Yes

TYPE_LINEAR_ACCELERATION

Yes

Yes

N/

N/

TYPE_MAGNETIC_FIELD

Yes

Yes

Yes

Yes

TYPE_ORIENTATION

YES2

YES2

YES2

YES2

TYPE_PRESSURE

Yes

Yes

N/A1

N/A1

TYPE_PROXIMITY

Yes

Yes

Yes

Yes

TYPE_RELATIVE_HUMIDITY

Yes

N/

N/

N/

TYPE_ROTATION_VECTOR

Yes

Yes

N/

N/

TYPE_TEMPERATURE

YES2

Yes

Yes

Yes

1 This sensor type is available in android1.5 (API
Level3) is added, but it can be used only after android2.3 (API level 9) is known;

2 This sensor is effective, but has been discarded.

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.