App as Lock Screen? -OR- Allow app to run when device is locked?


Question

I've got an old android device running CM11 (KitKat) that I'm using mainly as an alarm clock.



I'd like to be able to run only the clock app (Gentle Alarm) .... and then if I want to use any other apps like email or whatever, I'd have to unlock the device.



A lock screen widget doesn't quite cut it, as I'd like the full functionality of the alarm clock app (or actually, any app I select, for that matter) available, but as soon as I click the home or back button, I'd be taken to my lock screen.



I could see this feature being useful for lots of reasons... say if I had a tablet as a remote control for the TV/stereo that guests could use, yet i didn't want them running other games or apps.



Is this possible?



I'd be willing to consider other ROMs if that's what it takes.


Answer

Kiosk mode at your service


What you need is a solution that can put your app in . There are many apps in Play Store that can do this job for you. Simply search kiosk in Play Store. I believe that some of the apps providing child protection would more or less fit your need too. In that case, Izzy's list on app-locker should help.


Anyhow, I tested four apps that should help you without requiring flashing any ROM:


clyd Kiosk Standalone Lockdown


It is free/paid app. Free version restricts you to a maximum of two apps. Once the app is closed you'd be shown an interface with selected apps' icons and that is all. You can only launch those apps and nothing more. You cannot access Status bar either. You'd easily know how to exit this once you start using it.


MobiLock Kiosk Lockdown


It is a free/paid app. Free version does the job for us. I didn't test it beyond two apps so I do not know its restrictions, if any. Its usage and behavior is similar to aforesaid app. It's also easy to exit.


SureLock Kiosk Lockdown


It is a free app with in-app purchases. Free version should suffice your needs. It explicitly has Single-application mode and Multiple-application mode. The latter behaves in a manner similar to aforesaid apps and the app can be exit very easily. However, Single-application mode isn't very elegant. The traditional way of launching password prompt didn't work and hence, I had to force-close the app using .


Make sure you test this app in Single-application mode only when you've adb setup in PC and enabled and authorized in the device.


KioWare for Android Kiosk App


It is a free/paid app. I believe free version should be enough. Although I saw the documentation, I couldn't figure out why the app always expects that I want to visit a website and hence expect a browser. I couldn't make it work in Multi-application mode at all. Single-application mode worked but I didn't see a way to exit. Again, came for rescue.


Make sure you test this app only when you've adb setup in PC and enabled and authorized in the device.


It is very much possible that I didn't understand the usage of or couldn't satisfactorily use this app. Feel free to let me know in comments its correct usage.




Screen pin the app


If you can switch to, or are, already running a Lollipop ROM then you can use screen pinning. On Pin and unpin screens, Google has noted



You can use screen pinning to keep an app's screen in view until you unpin it. For example, you could pin a game so that you don't accidentally exit the game while you're playing. Then, when you're done with the app, you can unpin the screen to get back to the rest of your apps.



Read through the link to know how to pin or unpin an app or go to Settings → Security → Screen Pinning and read the instructions for its usage.


Know that you can easily unpin an app, more easily because Android directs you to unpin it using a toast, should you press a navigational key.


A simpler solution, only for rooted Android devices, is to block such toasts from showing up. Through jan's answer here I found EnhancedToast1 and UnToaster2 app very useful (individually) to block particular toasts. Since they are Xposed modules, you would need Xposed Framework appropriate4 for your Android version.




Lockscreen on-demand


On a rooted Android, you can try ProtectedApps3 app. Use ProtectedApps to protect your launcher app. Now whenever you would press the Home key or go back to a previous app (it must be protected too) you would see default or your custom lock screen. The app would show you its know-how at first run.




Ever-ready Tasker


You want to get your hands more dirty on a rooted Android, use Tasker, AutoInput and optionally, Xposed Additions.


Run Tasker in application context and choose your Alarm or alternative app(s) as trigger. Configure Xposed Additions to disable Home button globally or use AutoInput in a Tasker's task to do that. You can also use AutoInput to disable Back button specifically when you're at main activity of your app.


Follow my answer at Is there any way to disable/enable the back button? to know relevant usage of AutoInput and Xposed Additions, if required.




A tablet with Kitkat


If you happen to have a tablet with Android KitKat, this answer by user77535 may prove to be helpful. (I don't have a tablet so I can't verify it.)


It says, inside Settings → Users, you can create a Restricted profile which would more or less be an app locker to you. The profile however enables system apps and Settings app can't be restricted. It further adds that Xposed module Restrict Me can take care of Settings app here.




1: XDA: EnhancedToast

2: XDA: UnToaster

3: XDA: ProtectedApps

4: Xposed Framework: Android 4.x, Android 5.x and 6.x


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes