Tag Archives: boot check

boot_feature

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”>
                        <intent-filter>
                                <action android:name=”android.intent.action.BOOT_COMPLETED” />
                                <category android:name=”android.intent.category.HOME” />
                        </intent-filter>
   </receiver>

Give the permission like this –

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

And in your BootTracker.java file Paste this code –

 

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.

boot