Android Create An Activity That Float Over Lockscreen - android

I want to create an activity that float over the lock screen and do something with it, I think there is an order in which every app will appear one over another, but I don't know how. So i want to have both KeyGuard(will be always enable) and activity showing, so if the activity will have an transluscent theme(invisible background), the keyguard will be visible behind.
There is a way to create an activity that float over the lock screen? Thanks.
I tried this:
Android activity over default lock screen,
and similar solutions but with no luck.

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
Just add the above code to your onCreate() function.

This is not possible.
If 3rd party developers could put any activity on top of lock screen, what would be the purpose of lock screen after all?
On the other side, developers could trick users into thinking that current lock screen is authentic while they are not. And even could sniff user name and password (f.e. with pattern lock screen, when you've tried more then 30 times you need to enter the password to unlock).
The most developers can expect in future versions is the ability to add custom views into lock screen (something like in notification bar). But that is just my speculations.

Related

Entire screen overlay

just a simple question (hopefully):
Is there any easy way to make a simple translucent screen overlay on android? Just a solid color would work perfectly for starters. I would wager that this wouldnt be started as an activity but run as a service since the overlay should display over everything always until disabled, whether or not the application that hosts this overlay is running/paused/stoped.
It's easy to make an overlay for a specific activity/fragment, but I'd want this overlay to appear over the entire screen regardless of what's on screen (except maybe error dialogs, those seem to take presidence over anything).
Edit: To add more information, apps like "twilight" and "screen filter" seem to be able to do this sort of thing, whereas they are able to display a color at a custom transparency over the entire screen whether or not the app is running.
Yeah, it's possible to implement entire screen overlay using SYSTEM_ALERT_WINDOW permission and WindowManager, that's how Facebook chat heads works. Basically, you need to add your View to WindowManager instance, search WindowManager for more information.

Simple Button on Android Lock Screen with PIN

I am new in this forum and checked different threads here but did not found something similar to what I want to do...
Some Apps like MP3-Players or e.g. Spotify-App add some buttons when the lock screen is active (android nativ lock screen with PIN). In this case the displayed Date will dissapear to give more place to these "new" controls.
I have tried this without succes with a simple widget app by including android:widgetCategory="keyguard|home_screen" in the appwidget-provider xml information. The app widget is correctly operating on home screen but I see no widget when my screen locks.
So I think this uses other mechanism, may be an activity that hides the date and display controls on the lock screen.
Did anyone try something like this and can give me some tipp?
Thank you in advance!
Notes:
I dont want to implement a lock screen app, I would like to display a button and text on my lock screen like some common and existent apps do.
Used Android Version >= 4.2.2

Custom view like lock/unlock screen of android

I would like to create effects like lock/unlock screen of android. I have attached the screenshot here as well. In lock screen we have 2 buttons but in my case I am having 3 buttons and the middle button must be draggable.
The middle button can be drag to left/right.
I know I have to create custom view for this to work but I don't have any idea about how to drag button left/right with nice effect(animations) which normally any android phone have.
I need guidance on this, so can anyone suggest me how to approach for this.
Basically i wish to move/slide button left and right and based on that want to take some action.
I have tried making a lockscreen application myself and i almost made it, but here are the facts you will have to face at the end
You will not be able to disable home or menu button.
you will need user permission (not the one you get while installing the application, the menu pops up every time you press the home button unless the user decides to make your application default home screen, if that does happen you have successfully made a lock screen) if you decide to make a home screen application too.
the lock screen doesn't go very well with passwords
But if it helps, here's what i did:
You need to create a service that keeps a check on the screen being off and on.
if the screen is off, you do nothing. when the screen if ON you start the activity and wait for the user to do the thing you want the user to make him unlock the screen. and when he does that you finish() the activity.
While doing that you need to setup a method that can listen to check the incoming calls you can do that by extending PhoneStateListener and also disable the back button.
Good Luck and if you are able to make any further progress do let me know.
Maybe this project could help you GlowPadView. I've used it succesfully in one project. Hope it's what you're looking for.

Launch the Android App which is in No Longer Visible State

My issue is when an Android Application goes in the background. When I click the Home button and launch my app again from the home screen by clicking the Application icon, it should display the the same screen from which I went to the Home screen. But it calls the onDestory() method then comes out of my application. I thought the application is killed by the system because of memory requirement etc., but I need tokeep the activity and it should again show the same screen where I left instead of starting all over again.
This may be achieved like maintaining sessions.
try putting
android:alwaysRetainTaskState="true"
in the androidmanifest.xml for those activities, i think ICS does that by default now.
The Application will show you the same screen when return after "home" button if your app with different screens is made of different activities to show the interface parts... But if you just make some objects
visible=true or false
so, after resume you'll see the first view... Try to use Intents between different activities... And show a piece of code to help you... Maybe the problem is in overriding of onDestroy, onPause, onResume methods

Pass through touch events to app beneath

I'm working on an Android Activity which should not be full screen and thus uses Dialog theme. This can be achieved by adding
android:theme="#android:style/Theme.Dialog"
to the activity definition in Manifest file.
Visually that does what I expect. However, when the user interacts with the device in an area outside of this activity, the app in the background does not receive this input.
Is there a possibility to achieve this?
that is not possible with your solution as there is only one Activity possible to be active. You could try that with Fragments but I doubt that you could open your App and navigate the Homescreen / whatever in the meantime.

Categories

Resources