Let me begin by saying that, yes, I know that the stock Android lock screen can not be programatically replaced without rooting.
Now that that's over with, I want to make an app that contains a custom 'lock' mechanism. There are apps out there that emulate this functionality, namely LockGo. This allows a user to view information from widgets on a 'lock screen' and emulates the slide-to-unlock functionality (or whack-a-mole if the user wants to install that plugin).
Does anyone know what mechanism or Android API functionality they may have used to do this? Is it as simple as hooking into the power button to launch an activity, such as in the link below?
How to hook into the Power button in Android?
Any insight to this would be appreciated.
I've found out while researching this that, while there is currently no way to replace the stock security or keyguard lock (which I knew), it is possible to show an Activity on top of the lock using the following code in the setup for that Activity:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
This can be used with any logic needed to create a faux lock to show screens on top of the system lock(s), though the lock will still be in tact and the user will need to enter the lock to get into the device.
Related
I moved from iPhone to Android (Samsung S7) and missing one feature. In iPhone I could use quick access to set clock and timer and set direct from locked screen if to press a button at quick access panel, shown at the picture with arrow. Is it possible to make a similar quick access to clock app in android from lock screen? To put it in android quick access panel or in some other way like third party app, etc: aiming to access clock app set on lock screen quick w/o logging in? Same question with Calculator app.
In Android you can do almost everything with apps.
I found here some apps that allow you to create widgets on your lockscreen, you click on them, unlock your screen, and the app launches:
https://www.maketecheasier.com/launch-apps-lockscreen-android/
I own a OnePlus so I know they have this option build in.
You can also use the Xposed module "GravityBox" or "LockscreenMods"
(it is not possible to bypass the unlockscreen through a lockscreen widget!)
I am interested in building a custom lock screen app but would like to integrate into the built in system password lock screen.
My design idea is that the user would set a system password using the standard lock screen in android and my custom lock screen app would be given permission to bypass the standard lock screen and present them with a custom alternative way to unlock the device.
The user would be given the ability to fall back to the system lock screen if they wish. Also, this will give some leniency to my custom app just in case it does not work for whatever reason and woud allow a secure fallback to a system lock screen.
Is this possible in later versions of the Android SDK?
The short answer is no. You cannot edit the native android lock screens and security features related to them with the android sdk. You can however build your own and have that used if the native android lock screen is disabled, if it isn't you end up with two lock screens.
It may be possible to integrate in a minimal way with the "insecure" android lockscreen ie. swipe to unlock, which does not provide any security whatsoever.
I am building an app that will be in kiosk mode and must be over the lock screen its is possible using:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
However, I now need to programmatically lock the screen when the app is starting, looking at this link, I see it needs administrator privileges that are a bit more complicated on the lollipop version, has anyone managed that?
For your need, you can use the Screen Pinning. It's a new functionnality added in Android 5 to limit the application a task.
Programmatically, you can use Activity.startLockTask() and Activity.stopLockTask() to pin/unpin the application.
Some things to know :
If your application is not an Admin app, a popup will appear and you'll have to manually confirm the pinning mode.
No notifications will be shown in this mode.
The Home and Recent Apps buttons will have no effects.
you can unpin the application with no confirmation, and if you have set a Keyguard screen, you'll need to unlock it to go back to your Home application.
Is it possible to Display Information on the lock screen from an Android application.
I came across a few Apps which allow you to display Email and Calendar information on the screen but could not find which API to use for achieving the same.
Android 4.2 supports app widgets on the lockscreen.
according to the app you've mentioned (which has very poor description and quite low rating) , i suspect they disable the keyguard (the default lock screen) each time they get the event of power off (or on) .
maybe the activity that they are using has a transparent background and is above the normal lock screen .
there are many similar apps , such as "widget Locker" ,"magic Locker" and "quick Launch" , all do about the same thing to replace the keyguard . most of them also have the ability to replace the launcher (but will still show the launcher of the user, of course) , for smoother experience .
does the screenshot belong to the app you've mentioned , or to something you wish to achieve ?
You can learn how it can be done if you look at the sources of open source project contact owner that adds a message to the lock screen, too.
I haven't found a definite answer to this yet. Lots of apps let you build/install custom lock screens without root, etc. It's just like installing an app. I found this in the dev guide: http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SHOW_WHEN_LOCKED
I assume that while this is running it would run just like any other app. But how would I "release" it to let the user get to their home screen? And do I need to handle things like incoming phone calls?
You can't (at least if you follow the rules) replace the secure lock screen. You can have a lock-screen like activity that will show up when the phone is locked. Use FLAG_SHOW_WHEN_LOCKED, but notice that your activity cannot be transparent - i.e. it cannot be a dialog.