Search code examples
androidandroid-source

How to autostart a system app automatically?


I am creating a system app that open when first boot is complated. how can i start this app automatically ? i have the stock rom. is there a file for autostarting apps ?


Solution

  • You could do this in several ways:

    1. Have your app act as launcher ( set launcher declarations in manifest and set it as default launcher)
    2. Modify your default launcher (e.g. Launcher3) to start the app when the launcher starts.
    3. Modify SystemUI app to start your app when it first starts.
    4. Modify SystemServer or one of the system services ( e.g. ActivityManagerService ) to start your app when the correct boot phase is reached (e.g. PHASE_BOOT_COMPLETED )