How to get the Android application to start automatically after downloading and installing?

I look at the description of the Plan B application here: https://play.google.com/store/apps/details?id=com.lookout.labs.planb . It says that it will start automatically after installation. How to configure the application for this?

+4
source share
1 answer

Register to receive general intentions. Especially suitable for your purpose:

"android.intent.action.PACKAGE_ADDED" 

You can also listen to other intentions such as BOOT_COMPLETED etc.

Now I think that your application MUST have an Activity with a graphical interface (and not just a service and broadcast receiver) to start immediately after installation. Maybe I'm wrong, but I think I remember reading something in the Docs.

Edit: According to another answer to the stack overflow , you will not be able to launch your application immediately after installing it. You must register for other purposes, as I suggested. It should be noted that the application must obtain the permission of the user BOOT_COMPLETED .

Alternatively, if you are working with a root device, you can install the SSH client application and give it an IP address. You can then SSH and .. you know.

Update: as indicated in zapl, post 4.0, you cannot do anything after installation now, until the user explicitly launches your application.

+5
source

Source: https://habr.com/ru/post/1412396/


All Articles