Tag Archives: boot check


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 BootTracker.java 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.