Wednesday, August 17, 2011

Alternatives to the BOOT_COMPLETED broadcast

The normal way to start an Application or Service is to implement a Broadcast Receiver that listens for the "boot completed" broadcast. This approach will only work for Applications that are not installed on the SD card, because "boot completed" is broadcasted before the SD card is mounted, therefore the Application can never receive the broadcast, see also: http://developer.android.com/guide/appendix/install-location.html#ShouldNot. But it is generally a bad idea to force the installation on internal phone memory as it is restricted. It is more likely for a user to keep an Application installed if it uses as little as possible internal memory.
There is an alternative that can be used in many cases. The USER_PRESENT intent is broadcast when a user is present after the device wakes up, e.g. the user unlocks the screen. With this intent it is possible to start a service that is installed on the SD card.






5 comments:

  1. The most sinful, sinful, and sinful of all time
    The best gambling sites in the world · 경산 출장샵 Tropicana 원주 출장마사지 Casino 춘천 출장샵 · InterTops Casino · PlayMGM Casino · PlayFrank Casino · The Borgata 인천광역 출장안마 Hotel 고양 출장마사지 Casino & Spa.

    ReplyDelete
  2. Remember that you just always risk losing the money you guess, so do not spend greater than find a way to|you probably can} afford to lose. WikiHow is a “wiki,” just like Wikipedia, which implies that many of our articles are co-written by quantity of} authors. To create this text, forty nine individuals, some nameless, labored to edit and improve it over time. If this is your first time, stroll around and get to know the facility, especially if you're staying as a resort guest. Generally, 카지노 casinos are layed out with the motion within the center and the companies around the perimeter.

    ReplyDelete