Voice command to unlock the screen

I want to use a voice command to unlock an Android phone.

I tried the sample voice recognition code from android, but how to integrate it to achieve this function?

I have some doubts

1), should I use the service for this function?

2) when the phone screen is locked, can it have access to the Internet? (because Google voice uses the internet)

3) I looked at the PowerManager class, but using which method can I trigger my activity in voice mode when I press the power button? (phone is in sleep mode, locked)

Any guidance or decision / feedback is welcome!

thanks

+4
source share
1 answer

I am pretty sure that you will have to run this in the service, as it seems that it will be destroyed as soon as it is out of focus and the GC needs to be distributed ...

Regarding the awakening from sleep, I believe that this is the right direction.

Good luck.

0
source

All Articles