I am building a android application and I want to run this application in such a way that once it is installed in a device, that particular device should not be allowed to install any other applications. Basically restrict app installation to just one application(i.e mine).
I have looked at few options such a home launcher and tried but this allows me to install other applications as well. Is there a methodology where I can block other apps from getting installed in my device? Thank you.
You should take a look at this page:
http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_ADDED
When a package has been installed, you should receive a new broadcast event with this intent.
Basically, you have to force uninstall or lock the app with that package id. You'll probably need to be root on the device if you want to avoid a new activity to show up.
Related
If I restore an app from my old Android phone to my new Android phone and I don't launch it, will I still be able to get push notifications, receive broadcasts etc. for that app?
I know if you install an app from play store you and don't launch it you won't be able to but what about from a device restore?
Just did some testing and the answer is no. If you do not launch the app your code will not run even if you installed the app via device restore.
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 want to create an apk, without an user interface in android. And I need to start a Service as soon as the Applicaton gets installed on the Device. Is there any possible way to create an apk without UI.
Thanks in advance.
And I need to start a Service as soon as the Applicaton gets installed on the Device.
Fortunately, that is not possible for an app installed through normal channels (e.g., the Play Store), for security reasons, since Android 3.1. Nothing of your app will run until something on the device uses an explicit Intent to start up one of your components, and that most certainly does not occur when your app is installed.
You are welcome to build your hardware, or your own custom ROM, that has your app pre-installed. In that case, you can arrange to be able to run right away.
yes, you have juste to create a Service or a BrodcastReceiver which do something you want
I want to make an android app that runs as the only app on the android device. If the unit is reset I want this app to start up and run.
The reason for this is we are going to be buying these special 7 inch wall mounted tablets which have android OS on them (here is a link to the device: http://www.geekland.co/7-Android-42-Panel-PC-Wall-or-Desk-Mounted-Tablet-with-RJ45-GK-Q896.htm). And we are going to be programming an app that does various things.
However, it is imperative that the app cannot be exited and that if the system restarts, that app is what runs. We don't want random people messing with the device. We want to restrict everything just to that app.
Of course, maybe with an admin password you would be able to exit the app.
Can this be done somehow within an android app? Or does this call for, I don't know, making some new android OS clone or something? (something I'm not sure of how to do).
As I know there are few ways to do this.
Override buttons as in here
Write a home screen application as in here
Lock apps using apps similar to AppLock some can even lock system apps and settings
If the devices are running Lollipop or newer, you can do this with the Task Locking API. First you need to make your app (or some other app) the device owner and grant your app the lock task permission so that locking can be done without user confirmation. Then just add a receiver in your manifest for the BOOT_COMPLETED intent and lock the task when the app starts.
I wrote an open source app that acts as the device owner and simplifies granting lock task permission to your own apps.
Just want to know how to track what applications a user has uninstalled from their device in the past.
There is no log available that you can read way after the apps have been uninstalled (afaik).
All you can do is listen for the ACTION_PACKAGE_REMOVED broadcast while your own app is installed. It contains the package name of an app that the user just uninstalled.
There is no record of that on the phone/device and even if there would be it would not be available to a non-root application.