BOOT_COMPLETED BroadcastReceiver – How to check Boot is Completed in Android

Posted on .

Hello guyz , Today I am going to show you how to give and check that Boot is completed or not in Android.
You just need to give a permission and make a Class which will extends BroadCastReceiver.

Where to Use this Class – When you are integrating Push Notification in your Android Application then you need BOOT Tracker Class So that it will check any Push is come when your phone is off.

Registering the BootReciever in android manifest file

<receiver android:name=”.BootTracker”>
                                <action android:name=”android.intent.action.BOOT_COMPLETED” />
                                <category android:name=”android.intent.category.HOME” />

Give the permission like this –

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

And in your file Paste this code –

public class BootTracker extends BroadcastReceiver
            public void onReceive(Context context, Intent intent)
                   // Your code to execute when Boot Completed 
                    //Do Action
                   Toast.makeText(context, "Booting Completed Please Do your code here", Toast.LENGTH_LONG).show(); 


The onRecieve() method of BootTracker will execute when boot completes, so wee need to write the code inside onReceive() method.

Now Run Your Project and See the Magic.


2 thoughts on “BOOT_COMPLETED BroadcastReceiver – How to check Boot is Completed in Android

  1. Rohit Pandey

    Do you ever wonder how to make a ring on a phone which is in silent mode. We usually face such problem, when we try to make a call to our friend, and he doesn’t respond. One of the reason may be he couldn’t realized the incoming call due to silent mode activation in his mobile.
    Using this app, you can call your your friend and it automatically changes the mobile profile ( of your friend) from silent to loud mode.
    This app is also useful if you have misplaced your phone in room/office etc.
    take a look at “True Friend”


Leave a Reply

Your email address will not be published. Required fields are marked *