Thursday, October 8, 2015

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


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




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:



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.



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.



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.



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.





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.





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.





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.





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


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...