Is there any way to detect when an application begins installing? More specifically, when the system is running the packageinstall.apk - Can I capture this moment?
I want to alarm user before apk is installed. I have tried the ACTION_INSTALL_PACKAGE but it does not work. (ACTION_PACKAGE_ADDED is not what I want either.)
There is no easy way to do this. The best you could do is check after the app has been installed whether or not you want it on there and act accordingly.
Related
I want to lock my android device as soon as a particular event happens in an application. The application will keep running in the background and lock the device as soon as the event happens. I tried plugins like flutter_screen_lock but they only provide locking within the particular app while I want the complete device to get locked.
Quick answer to your question this is not possible. If it would be possible both App Distribution Providers (App- and Play Store) would not accept your App because it would be against those Rules.
In android is there any way to stop specific app. Let suppose i want to stop the whatsapp so is there any possibility? I have tried Force Stop method but it does not works. Whatsapp automatically turn on after sometime.
Whatsapp like apps must have internal timers on the background service to restart it's services. So it invokes itself sometime later. Try to stop another basic app like calculator.
If you want to do programatically then you have to get permission for Administrative. And then your app will be able to kill other Apps. Like Greenify.
If you want to kill applications -> Use Greenify -> Auto Hibernate options. It will automatically hibernate applications after certain period of time.
Third way is root your phone and edit the permission of application. -> Remove permission of Boot to Turn on flag.
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
After 3.1 , Android introduced a security feature, where the application's code can't be run unless the user opens the application. Check the link for more info http://commonsware.com/blog/2011/07/13/boot-completed-regression-confirmed.html
I would like to know if anyone has found any hack or work around for this problem, where i can listen to a system broadcasts like boot, connectivity changed and run a service without opening the installed application.
This is not what the posts said. You can still register broadcast listeners, or alarms. You just need the user to actually start your application once. And, if the user forcefully stops your application, they'll need to start it manually again.
Why would you want a way around this behavior? It seems to make a lot of sense.
My team is trying to build an Android application for a tablet that will be dedicated for this sole purpose. One of the requirements is that the application is the only thing running on the device (at least from the user's point of view). The user should not be able to close it or use any other functionality from the OS (settings, other apps, etc.).
We have been doing some research and so far have not found anything. Is this we are trying to do even possible ? Does anybody have any idea how we could approach this ? Maybe blocking the buttons ?
Thanks,
It is possible but would be ugly in the long run without a custom built rom (http://xda-developers.com has instructions on how to do this), I wouldn't know where to start code wise - but there are a couple of applications which portray this kind of functionality - TodlerLock is one such app - its designed to stop todlers from from doing anything on the device, whilst the application keeps them entertained. It appears to intercept all button presses and acts as a home application to do this for the home button.
Then there are the programs like estrongs security manager that allows a user to set a password for some or all applications and basically stops the application being run without the password (it appears to intercept the intents and opens the security manager requesting the password first, if it fails it finishes the intent) - this maybe a much easier option to use something like this - you could set a password for most things, including settings and the security application itself, everything bar your application. This will stop the user doing anything you dont want them doing without the password.
You would have to set up the device for the user before hand though, as any home screen intercepter application can be changed but the user - so you would have to set the default, then lock access to the settings so the user can't change this action.
I think the only way of doing this to have your own custom version of Android built only for you. Get the android source, remove what ever you don't want and build it. I am not sure if you would ever want not to close it but you can make sure they can't install anything else on your ROM.
Im not sure about this, but, intercept the home intent and write your own custom home?
It sounds a lot simpler than writing your own custom rom.
This is not possible without OS changes. You cannot override the home button.