Android Boot service background run Android boot will send a broadcast Android.intent.action.BOOT_COMPLETED, capture this broadcast, and then can do the appropriate operation, For example: Activate activity by capturing a boot broadcast, or service. 1, new Bootbroadcastreceiver class, inherit Broadcastreceiver. public class Bootbroadcastreceiver extends Broadcastreceiver { private final String action_boot = " Android.intent.action.BOOT_COMPLETED "; @Overridepublic void OnReceive (context context, intent intent) {if ( Action_boot.equals (Intent.getaction ())) {System.out.println ("BOOT receiver start......\n"); Context.startservice ( New Intent (context, Collservice.class));} } }2, androidmanifest configuration <receiver android:name= "Com.example.BootBroadcastReceiver" >< Intent-filter android:priority= "><action" android:name= "Android.intent.action.BOOT_COMPLETED"/>< /intent-filter><intent-filter android:priority= "><action android:name=" Android.intent.action.MEDIA_MOUNTED "/><action android:name=" Android.intent.action.MEDIA_EJECT "/>< Data android:scheme= "File"/></intent-filter> </receiver>
Android boot up service background run