java - How to make screen turn on when motion sensor detects something? -


is there way turn screen on when motion sensor detects phone moved? in advance.

consider this

//implement sensoreventlistener public class sensoractivity extends activity, implements sensoreventlistener { ......  sensormanager sensorman = (sensormanager)getsystemservice(sensor_service); sensor sensor = sensorman.getdefaultsensor(sensor.type_accelerometer);  sensorman.registerlistener(context, sensor,     sensormanager.sensor_delay_ui);  @override  public void onsensorchanged(sensorevent event) {       if (event.sensor.gettype() == sensor.type_accelerometer){        }      //or other sensor.   }   

there's more info in docs here


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -