I have more or less been able to understand and implement all these concepts in parts but somehow totally confused as what to put where and how do they fit together.
In short this is what I am trying to achieve on a non-rooted android phone
- Have an SMS broadcast receiver listen for incoming SMS with secret code
- Lock the screen if sms has keyword lock.
How do BroadCastReceivers and DeviceAdminRecivers go hand in hand?
Eg. I have the working code for intercepting an SMS. A switch case which calls a dummy(empty) lockScreen() function. Now where should I put DeviceAdminReceiver’s code so that I can lock the screen (a new Activity with a password box with HOME and other menu buttons disabled) ?
So basically its from BroadcastReceiver -> Device Admin -> Activity.
Please help me.
The easiest way would be to create a custom HOME screen and add features mentioned below so that it looks like a custom lock screen :
P.S : DeviceAdmin can be used to lock your phone and show up the system default lock screen if the password has been set