I want to use light sensor to detect the environment of phone changing, then protect the phone from being stolen. But I don't know whether, if the screen is turned off, the sensor still works or not. And, can anybody make some suggestions how can I make this goal? If I register a sensor in the service, will i make it?
I know that, using context.getSystemService(SENSOR_SERVICE), I can get the sensormanager, register the sensor, and implement the SensorEventListener. Through the sensorevent.value I can get the value of lightsensor.