FrenchCreation
FrenchCreation

Reputation: 1

Is there a way in Android studio of polling the light sensors rather than waiting for a SensorEvent?

I need a very high rate of information from the light_sensor in android studio and i can't get it with an event so i want the real time information if its possible

@Override
            public void onSensorChanged(SensorEvent event) {
                float value = event.values[0];
                currentTime = Calendar.getInstance().getTime();
                result[i] = formatter.format(currentTime);
                tab[i]=(int)value;
                Text.setText(String.valueOf(value));
                i=i+1;
            }

Upvotes: 0

Views: 80

Answers (1)

Chrystian
Chrystian

Reputation: 1047

I think you mean on Android, and not in Android Studio. Android Studio is the IDE that you are using.

In general the light sensor on most Android devices only returns an onsensorchanged event when the light intensity changed.

Upvotes: 0

Related Questions