Android lock without lock

Let me start by saying that, yes, I know that the Android lock screen cannot be programmatically replaced without rooting.

Now that I am done with this, I want to create an application that contains a special locking mechanism. There are applications that emulate this functionality, namely LockGo. This allows the user to view information from widgets on the "lock screen" and emulates the functionality of the "slide-unlock" (or whack-a-mole if the user wants to install this plugin).

Does anyone know which mechanism or functionality of the Android API they could use for this? It is as simple as connecting to the power button to start the activity, for example, in the link below?

How to connect the power button in Android?

Any understanding of this would be appreciated.

+4
source share
1 answer

I found that by researching this, although there is currently no way to replace the stock lock or keypad lock (that I knew), you can show Activity on top of the lock using the following codes in the setting for this Activity :

 getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); 

This can be used with any logic needed to create a faux lock to display screens on top of system locks, although the lock will still be in tact and the user will need to enter the lock to enter the device.

+1
source

All Articles