安卓软件要想开机自启动的话,需要监听BOOT_COMPLETED这个广播。另外还需要注意,有些管家型的系统软件会阻止后台服务开机自启动的。
http://iaiai.iteye.com/blog/1076152
亮点:
接下来,我们只需要在应用程序配置文件AndroidManifest.xml中注册这个Receiver来监听系统启动事件即可,如下所示:
Java代码
1.<receiver android:name=".service.BootReceiver">
2. <intent-filter>
3. <!-- 系统启动完成后会调用-->
4. <action android:name="android.intent.action.BOOT_COMPLETED">
5. </action>
6. </intent-filter>
7.</receiver>
捆得像电磁铁线圈一样
HxLauncher: Launch Android applications by voice commands