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.
dcow source share