I am running a background service that restricts users from launching applications, even when my application is not in the foreground. Is there any way to stop them from being able to launch certain applications?
Launching of app is handled by the Launcher. This cannot be controlled from a third party app. Neither Android provides you the app lauch details like a broadcast.
Related
My application has 2 different possible launch scenarios : standalone or launched by another app (with specific intent).
If launched in standalone mode after it is launched by another app, my app is completely broken (I deal with bluetooth, etc).
Is there any way to know when my app is launched from another app whether or not my standalone app is already running on the device?
I am developing an android app for a company. Their employees must not use any other apps but the company-app,the preinstalled phone-app to make calls and the settings.
So I created a custom launcher and registered it as default. The launcher shows only the allowed apps. But the employees could open the settings and set the normal android launcher as default (and then use the internet for doing unallowed things or download malware) or uninstall my launcher.
Is there any possibility to prevent this without rooting? If I register the laucher as device administrator they could open the settings and disabling it.
Note: I have full access to the devices before they were delivered.
Best regards
I found a solution
1. I registered my app as boot-receiver
2. I created a service which tests which activity is in foreground (if it is from the whitelist: OK, otherwise: my app comes to foreground, blocks the foreground-activity and shows the user a warning "don't do this")
The next problem was: the user should be able to use the settings (for wifi), so he could uninstall my app.
3. Register my app as device admin (the user is unable to uninstall or force-stop my app until he unregister it as device-admin)
While testing which activity is in foreground, the service tests if the app is still device-admin. If it isn't device-admin, all apps were blocked until the app is device-admin again (the dialog pops up).
I have a service in my app along with activity classes. I want to start service as soon as app is installed. I have been able to start service on app launch,on device reboot, but not on app install.
Any idea if it is possible and if possible then how it can be done?
Thanks in advance.
Any idea if it is possible
Upon installation, your app is in the so-called "stopped state" and will remain there until something uses an explicit Intent to start up one of your components. Unless your app is a plugin for some other app that will do this, your app will not run until the user taps on the home screen launcher icon associated with one of your activities.
I want to write an application that can prevent some application from launching. My requirement is to block some application for some period. So what is the way to block or prevent others application from starting or launching through my application.
My question is -- Is it possible to prevent launching other application from my application? If yes then what is the way.
I tried killing the running application. But it only kills when the application is in the background. When the application is in opened state(displayed on the screen) the killing of the application is not working.
So what is the way to block or prevent others application from starting or launching through my application.
Write your own home screen, so you are the one doing the launching, and implement your launching rules there.
This will cover basic scenarios. It will not help with:
Stopping apps that are launched via notifications (e.g., in response to an incoming SMS)
Stopping apps that are launched via other things in the system bar on tablets (e.g., some tablets let you get to the Settings app from there)
Stopping the user from rebooting their device in safe mode and getting rid of your home screen
The only way to handle those scenarios is to create your own ROM mod with adjustments to the operating system, then distribute that ROM mod (e.g., on your own devices).
I have developed a Service for Android that starts when BOOT_COMPLETED is received.It works fine on versions prior to 3.1.
I newer versions tough I understand the application must be launched in order to receive this broadcast . How can I launch my application if I don't have an User Interface ?
You add a user interface, in the form of an activity that the user can launch. Besides, this is where you need to:
Allow the user to stop and start your service, since the user may not want your service to be running 24x7 and you do not want the user to have to resort to Force Close
Display your documentation
Display your license agreement