I want to lock my application in recent applications in oppo phones as shown in the image programmatically so that I can run my services in the background after the application has been killed. is it possible?
Make sure app is on.
Go to recent apps (which is the square button you always press to clear background apps).
Instead of swiping up to clear the app, you swipe down to lock/unlock the app.
You are not allowed to this programmatically :)
Related
I moved from iPhone to Android (Samsung S7) and missing one feature. In iPhone I could use quick access to set clock and timer and set direct from locked screen if to press a button at quick access panel, shown at the picture with arrow. Is it possible to make a similar quick access to clock app in android from lock screen? To put it in android quick access panel or in some other way like third party app, etc: aiming to access clock app set on lock screen quick w/o logging in? Same question with Calculator app.
In Android you can do almost everything with apps.
I found here some apps that allow you to create widgets on your lockscreen, you click on them, unlock your screen, and the app launches:
https://www.maketecheasier.com/launch-apps-lockscreen-android/
I own a OnePlus so I know they have this option build in.
You can also use the Xposed module "GravityBox" or "LockscreenMods"
(it is not possible to bypass the unlockscreen through a lockscreen widget!)
I'm working with a client who would like their app to always be visible on the tablet screen for their in-shop/display model. They would like this app to be locked on the screen so that if a person presses the home button it will go home and the app will stay open. Basically they want the app to be the only thing on this tablet. Are there any solutions from a software perspective that I can implement?
Set the application to kiosk mode
https://developer.android.com/work/cosu.html
https://sdgsystems.com/blog/implementing-kiosk-mode-android-part-1
I have developed a custom launcher/homescreen and it has been working perfectly on all android version for nearly two years. So far this launcher has been used in various Samsung devices.
Currently I am testing it in new huawei lua-u22 device. My launcher runs, can be set as default and shows up other apps on top of launcher too. But if I run another app (for example Gmail), screen lock(Swipe only) for 20-30 second, unlock device then press back button then instead of bringing it back to my launcher it goes back to default huawei homescreen. I checked by going to the settings-> home and there my launcher was still set as default. It only brings back my launcher home screen when I press home button again.
Is this problem of huawei device that is always redrawing default huwaei home as homescreen? Is there anyway I can track default selected home change at any time?
I found out the reason. In huawei after screen is tuned off my app was getting killed.
Huawei has a feature Protected Apps which allows application that is enabled in the list to keep running when screen is turned off. After I allowed my app in Protected apps it was not getting killed after screen turned off and everything now working properly.
To enable this feature go to System settings (which you can either find in the quick toggles portion of the notification shade by pulling down the status bar on the top portion of the screen). Go to All tab, Scroll down to Privacy and Security section, go to to Protected Apps and enable your app(this will control what’s allowed to run when the screen is off and what isn’t)
In stackoverflow there are few codes available to run this screen pro-grammatically which I do not find reliable enough as it may change in any new version of device.
I am making one lock application and for that I need to disable home button. I already tried all the common solutions available and it works for other android versions but for this device which is running on Android 4.2.2 it fails always.
You can't disable the home button as it can cause security issues promoting malicious apps etc.
What you can do is add an overlay to your app instead that will cover over other apps.
See this link for more info:How to disable Home and other system buttons in Android?
Make application as launcher.
First time when home button is pressed, device ask for choose launcher, select your applicaiton with always options.
From the next time when application is opened and you press the home button app never go in background.
I am building an app that will be in kiosk mode and must be over the lock screen its is possible using:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
However, I now need to programmatically lock the screen when the app is starting, looking at this link, I see it needs administrator privileges that are a bit more complicated on the lollipop version, has anyone managed that?
For your need, you can use the Screen Pinning. It's a new functionnality added in Android 5 to limit the application a task.
Programmatically, you can use Activity.startLockTask() and Activity.stopLockTask() to pin/unpin the application.
Some things to know :
If your application is not an Admin app, a popup will appear and you'll have to manually confirm the pinning mode.
No notifications will be shown in this mode.
The Home and Recent Apps buttons will have no effects.
you can unpin the application with no confirmation, and if you have set a Keyguard screen, you'll need to unlock it to go back to your Home application.