I've made an app that has the unlock formatting that I want, but I don't know how to make it so that I can select that as the device security screen lock, or even if it is possible.
At the minute I have it so that when the phone is unlocked, the unlock app starts - however there is always a slight delay, and the app toolbar is visible at the top for a short period of time.
I've looked around for a very long time and not been able to find any resources on this other than with what I've already done, any help would be greatly appreciated.
(If it helps, the device I'm developing for is using Android 6.0.1)
Are you talking about a custom screen lock?
This may help.
https://github.com/Joisar/LockScreenApp
Okay in the LockScreenApp Activity class
every method call in the onAttachedWindow method needs to be moved to the onCreate method
Related
I am developing an app that locks the screen for some time, just like parental control apps do when the screen time runs out. However, I do not really know how they work. I suppose they don't use lockNow because there is that message that shows up telling you that the time has run out. I also don't think they use overlays, because the phone is supposed to detect the use of overlays. So does anybody know what kind of function is used? Also for my app I want to add a button that ends the screen lock, so I am looking for a suitable way to achieve that.
I have a problem that I don't really know how to solve and also the threads here at SO haven't fully helped me.
Here's the issue: I want to have an android app that I can start whenever I want, and then, when I click on a button, I want the app to be somewhat "locked". By that I mean: after this button was pressed, the user is not able to close(see edit below) the app. Also, the app should immediately start after rebooting the device.
This lock can then be revoked by, say, entering a passcode, which makes the app run normally again.
So far I understand how to build kiosk applications. However, a kiosk application needs a particular manifest which will make it always a kiosk app, and not "on demand".
I'd greatly appreciate any hints and tips on this topic. Thank you so much!
EDIT: by "close" I really only mean completely turning the app off, not only going back to your home screen. Such that the app is always running in the background
You can programmatically lock and unlock the App in Android 5.0 http://developer.android.com/about/versions/android-5.0.html#ScreenPinning
I am making an alarm app using androids SDK and Java in eclipse.
I have a method that is called when the alarm goes off. This method is called even when the app is closed or the phone is locked. I want this method to unlock the phone even if its password protected(is this possible?). Then when the phone is unlocked (by the method if possible) (or the user if not) i want the app to be automatically started?
Is there any thing that would do this?
I do have experience in android but i am not an expert, so i would really appreciate everything explained to my beginner level. Some sample code would really help me, and would be totally appreciated.
Thanks, Jack
The answer to this question of course depends on which version of android you wish to target, the following is an untested way that should work on API level 5 (android 2.0) and up if called from within an activity (or called on an activity):
getWindowManager().updateViewLayout(this.getCurrentFocus(), new WindowManager.LayoutParams(WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON));
This code causes the current view of the activity to be displayed over the lock screen by updating the view to use the SHOW_WHEN_LOCKED and KEEP_SCREEN_ON flags.
On an android App I made, whenever the user turns the app to the side, the app turns sideways and restarts (this was on the droid). I don't want to this to happen. I want the app to not restart when the device is turned sideways.
Also I would prefer the app to be locked in the vertical position.
How would I go about this two thing?
Thanks in advance.
This has been covered numerous times Android, how to not destroy the activity when I rotate the device?
Today I am looking for a way to mimic the behavior I know from my HTC Hero's lock screen: the calendar and alarm clock can put text & drawables there to inform about an upcoming event or an expired alarm. The lock screen remains there in that it must be dragged down to dismiss the shown event and there might also be a Snooze button.
But, first question: is this default Android stuff or HTC Sense specific only??
Second question: If it is a common Android thing, why can't I find anything in Google's Android documentation for the topics "lockscreen" or "lock screen" that comes close to my question? Where's the API for it?
My problem is: I want to inform the user immediately - even if I try a standard notification, the user with a locked screen will have to unlock it and drag down the notifications list to see & clear what's going on. sigh Putting an endlessly playing notification sound there is a hassle as it takes at least two swipes down to stop the sound playing!
Any hints on this?
Thanks!
is this default Android stuff or HTC
Sense specific only?
It is HTC Sense only. You cannot modify the lock screen of the device from SDK code -- only via firmware modifications. Sorry!
It's kind of o long way around the problem...
but the wallpaper is shown on then lockscreen. so you clould write a custom wallpaper to display your info on the lockscreen. (i think).