我需要在开机时启动服务。我搜索了很多。他们列出有关的BroadcastReceiver。由于我是新的android开发,我没有得到有关在Android的服务,清晰的画面。请给我提供一些源$ C $ C。
I need to start a service at boot time. I searched a lot. They are listing about Broadcastreceiver. As I am new in android development, I didn't get a clear picture about services in android. Please provide me some source code.
在此先感谢。
创建 的BroadcastReceiver
,并用它来接收的 ACTION_BOOT_COMPLETED 。您还需要 RECEIVE_BOOT_COMPLETED 权限。
Create a BroadcastReceiver
and register it to receive ACTION_BOOT_COMPLETED. You also need RECEIVE_BOOT_COMPLETED permission.
阅读:监听和广播的全球信息,并设置报警