Boot Reciever

A boot reciever is a listener that picks up an intent that is sent when the phone boot animation has stoped. the first thing that needs to be done with it is register it in the manifest

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

<receiver android:name=“com.lukemovement.example.BootResiever”>


<action android:name=“android.intent.action.BOOT_COMPLETED”/>

<action android:name=“android.intent.action.QUICKBOOT_POWERON”/>



the next bit is creating the activity that responds when the boot complete intent is recieved

package com.lukemovement.example;

import android.content.BroadcastReceiver;

import android.content.Context;

import android.content.Intent;

import android.content.SharedPreferences;

public class BootResiever extends BroadcastReceiver



public void onReceive(Context context, Intent intent)


if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {

//intent to start a new main activity

Intent i = new Intent(context, BootActivity.class);






and it is as simple as that