Would it be possible to listen for events while the phone/screen is locked. Like for example, to record sounds and process that in the background?
Thanks,
Would it be possible to listen for events while the phone/screen is locked. Like for example, to record sounds and process that in the background?
Thanks,
Running service are down when the phone is locked, but you can acquire WAKE_LOCK key and do your task
PowerManager mgr = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
WakeLock wakeLock = mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"MyWakeLock");
wakeLock.acquire();
this will hold the CPU open even if the screen off, then you can do your process in background