Is it possible to record audio on Android while lock screen is on?

好久不见. 提交于 2019-12-04 18:41:24

you should try using PowerManager class with permission android.permission.WAKE_LOCK.

you can find more Here.

Yes it is possible. Lock screen does not affect the working of services in an application. So if you are using a service, then your recording will proceed. However, if your phone is in standby, then it may not work. In that case, just grab a wakelock to keep the CPU alive and function your needs. However, grabbing a wakelock affects battery, so you must use it intelligently.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!