开发者

How can I run an android application permanently in the background when the phone is switched on?

I am creating an application which is use Service Component and Activity Component ,I want to run the application always in background . Suppose we switch off the mobile and when we on the mobile our application is closed but we want run in that situation also i.e. automatically. T开发者_StackOverflow社区hank you.


I believe this post answers your question:

http://androidgps.blogspot.com/2008/09/starting-android-service-at-boot-time.html


Register for broadcast receiver, look for intent BOOT_COMPLETED. Implement the logic to start your application if its not started in its onReceive method. Check the following useful links: http://www.androidsnippets.com/autostart-an-application-at-bootup http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜