Simple Button on Android Lock Screen with PIN - android

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

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.

Android - how to know if user click on Home Screen

Is there a way to know if some user is clicked on the Home Screen of Android device. Something like homeScreen.onclicklistener
I tried to create a widgets and to listen for clicks, but this is not possible task, because there is no way to create widgets programmatically(auto adding), or maybe I don't know how to do it. I know this way is wrong but I had to tried.
Thanks in advance.
Screenshot from the Home Screen.

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.

Android Create An Activity That Float Over Lockscreen

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.

Android Application Layout

Hi does anyone know how to implement a layout change in the application. For example, when a user sees a text box prompt and turns the phone sideways and views the application as a landscape view. I have no idea how to go forward with this?
May I add that I know I have to create a layout-land xml. I'm ok with that bit, it's just I'm not sure how to make the phone automatically detect that it is oriented sideways and needs to implement the landscape view.
Many thanks.
If the phone supports orientation changes and you've turned it on in Settings (Display > Auto-rotate screen) everything should work automatically. The Activity will be restarted and the correct layout file used.
See this post here för details: Android: alternate layout xml for landscape mode

Categories

Resources