VOOZH about

URL: https://www.geeksforgeeks.org/android/how-to-launch-an-application-automatically-on-system-boot-up-in-android/

⇱ How to Launch an Application Automatically on System Boot Up in Android? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Launch an Application Automatically on System Boot Up in Android?

Last Updated : 3 Jun, 2026

In Android, applications can be configured to start automatically when the device finishes booting. This is useful for kiosk systems, IoT devices, robotics projects, and other dedicated applications. Android provides the BOOT_COMPLETED broadcast, which notifies apps when the system has completed startup, allowing them to launch an activity or start a service.

  • Android sends the BOOT_COMPLETED broadcast after the device finishes booting.
  • A BroadcastReceiver can listen for this broadcast.
  • The app must declare the RECEIVE_BOOT_COMPLETED permission.
  • The receiver must be registered in the AndroidManifest.xml file.

Note: Launching an app automatically on boot is officially depreciated by Android

Step by Step Implementation

Step 1: Create a New Project in Android Studio

Create a new Android project using Android Studio. You can choose either Java or Kotlin as the programming language.

Step 2: Create a BroadcastReceiver

Create a class named StartupOnBootUpReceiver that extends BroadcastReceiver. A BroadcastReceiver allows an application to respond to system-wide events such as:

  • Device boot completion
  • Airplane mode changes
  • Battery status updates
  • Incoming calls or messages
  • Connectivity changes

Step 3: Adding Permission to AndroidManifest.xml File

Navigate to app > manifests > AndroidManifest.xml and add the piece of code given below to the file.

<uses-permission
android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

Step 4: Working with the XML File

Next, go to the activity_main.xml file, which represents the UI of the project.

Output:

Then restart your phone/emulator. It will automatically restart based on how much time your system takes to boot up.

👁 Launch an Application Automatically on System Boot Up
Comment

Explore