I tried to make the lockscreen application on my own, and I almost did it, but here are the facts that you will encounter at the end.
- You cannot disable the home button or menu button.
- you need the permission of the user (and not the one that you get when installing the application, the menu appears every time you press the home button, if the user does not decide to make his home screen your default application, if this happens, you successfully made the screen locks) if you also decide to make a home screen application.
- the lock screen does not work well with passwords
But if that helps, here is what I did:
You need to create a service that keeps the check on the screen turned off and on.
If the screen is off, you are not doing anything. when the screen is on, you start the action and wait for the user to do what you want the user to force him to unlock the screen. and when he does this, you complete () the activity.
In this case, you need to configure a method that can listen to incoming calls, you can do this by expanding PhoneStateListener and disabling the "Back" button.
Good luck, and if you are able to make any further progress, let me know.
source share