This question already has an answer here:
Custom Lock Screen Implementation Techniques
(1 answer)
Closed 7 years ago.
I need to put my app on the lock screen (android 2.2)!
I think there are two options for do this:
Develop an app to replace android's lock screen. This app whould be called when the off button is pressed.
Insert my app button into android's actual lockscreen, so, my app would work, even if the screen is locked, and eventually, my app could unlock the screen.
I don't know how to do it, but I do know it is possible, since some music players can be downloaded and the music player options are in the lockscreen.
Can anybody help me out?
thanks.
(1) is totally feasible and there are many lockscreen alternatives apps available.
(2) will depend on what lockscreen are you talking about and what is what your app does. Firmware lockscreens do not allow usually widgets in them. At most, they have a method to interact with the call/sms log and the music player, but that's it.
So, unless your app does one of those two, your only option is pretty much (1).
Related
This question already has answers here:
Android, Detect when other apps are launched
(8 answers)
Detect When other Application opened or Launched
(3 answers)
Closed 23 days ago.
I want to open my app when some other app is opened.
Ex:
I want to open my game launcher when some game is opened and i want to draw over the other app
How can i make this in android studio? If you found any online article or videos attach the link down.
If you want to be notified of the execution of other applications, you must use AccessibilityService, by activating AccessibilityService, your app will be notified whenever a application is executed, this is the simplest and best solution for that.
You can also get permission Appear on top to draw on other apps or start an activity from your app instead of drawing, there is currently no other control solution.
I want to code my own clock, replacing the one on the lock screen. Not to sure how to do this? I only designed app that displays data from firebase. Is there a way to display using flutter or java, information like a clock or a graph on the lock screen? I can only find examples of full screen notifications.
nope, there is no option for that. Lock screen is a separated built-in app which can't be changed by other software
BUT you can write own lock screen app, with own clock. But remember to handle other common/important features, like validating user, showing (all/non-private) notifications, allowing 112 call etc. Lot to do
I have an Android app that is transparent that monitors for an event and then displays a message and toggles the background between transparent and a translucent red. The app itself is working exactly as I was hoping. The problem is that only the top most app (my app) is active and updating the view. The app displays over a 3rd party app that runs a live video stream. I want the live video stream app to continue to update while my transparent app is on top. Since I have no control over the other app and it doesn't support multi-window approach, I am looking for a different approach or work around to accomplish the same thing.
I have read of people trying to use a system popup based on a service. Does anyone have experience trying to solve a similar problem and found a good approach for designing the app or a work around?
Try to google about Activity lifecycle. When another app comes as the top application (let's say your transparent app) the last playing application goes to onPause until the user bring the last app back to the top again.
The short answer is: what you want is not possible.
any question?
I wanted to understand how does the Android OS figure out which home screen the user is viewing currently and render the appropriate icons and widgets on that screen based on the user's left or right swipe on the touch screen of the device.
The OS must save a state of the screen and IDs or something relative to the objects placed on the screen to retrieve the state each time the screen becomes visible.
From my research I understand that Android OS treats all the 7-8 homescreens on devices as one single host.
Also my question might seem vague, but the reason why I am asking is because it seems reasonable that app widgets on android devices, update not only when the phone is awake but also only when the app widget itself is visible. I know that Google has declined the enhancement request by many others but I don't think that is good enough. Link here.
That is the reason why I am trying to give it a shot to understand and implement it for my app with whatever Android knows about the state of the home screens.
Any help or insight is much appreciated. Also the experts out there let me know if you think this can be even implemented for one off apps at all?
Well, as the link you posted clearly states, there's no way to know.
Also, if you consider the fact that "Home" is just an application like all the others, it makes even less sense to have a unified API for that. A lot of people use Launcher Pro or similar applications, which would probably not implement it.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Lock the android device programatically
I have made a simple Android app with a pin-code/screen lock. The user have to write a password to lock the phone and then repeat it to unlock the phone. The problem is that the user still can press back, home (etc) to exit the app without writeing the code. How can I prevent this?
You can block the back button by overwriting dispatchKeyEvent() in your Activity class, and returning true if event.getKeyCode() is equal to KeyEvent.KEYCODE_BACK. But you cannot block the Home button from going to the home page.
I have heard of some trickery where you register your application as a receiver of the android.intent.category.HOME intent. This would cause the Android OS to load your activity if the user presses the home button. If you can get this to work, you could then load the "actual" home screen if the user has entered the correct password. This approach is likely to behave differently on different devices and Android versions, however, and it probably would do nothing to stop the Hold-Home task list from appearing.
The bottom line is the Android OS has been designed to prevent just the thing you are trying to do: an application should not be able to take control over the phone and prevent other applications (especially the Phone) from running.
It's my understanding that you cannot block the home key as it's a security feature that allows the user to always exit an app. Pressing home will not close the activity however.
the guys who created free "Toddler lock" apk somehow managed to did it - download and see for yourself :)
when you run it, it asks for permission to run as home app and you need to check the box "use as default". To exit from app, you need to press on all 4 corners of the screen. All the buttons but power one are locked. So there is a way for sure to do that!
he explains to users how it works here:
http://www.toddlerlock.com/3.html