BOOT_COMPLETED BroadcastReceiver – How to check Boot is Completed in Android

Posted on .
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

  • 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”

    http://pandeybrosapp.blogspot.in/

    https://play.google.com/store/apps/details?id=com.rht.truefriend&hl=en

  • Gurleen Singh

    very easy , … i was using it on push notification :O