简体   繁体   中英

Android light sensor array data

In the Android developer guide , when dealing with the light sensor, it says:

// The light sensor returns a single value.
// Many sensors return 3 values, one for each axis.

And then proceeds to take the first value of the array:

float lux = event.values[0];

In some cases, I get 0 in the first place of the array and a nonzero value in the second and/or third.

I tried to look for the meaning of this vector, but I couldn't find an explanation.

Can anyone please explain?

The data from the light sensor in lux is located in event.values[0].

Quite a few of the current Android phones have an RGB light sensor. In some cases the data you are getting via the second and third places in the array is related to that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM