Thursday, May 3, 2012

Re: [android-developers] starting a service after installation

On Thu, May 3, 2012 at 1:15 PM, guich <guihazan@gmail.com> wrote:
> How can i start a service at the first time that the service apk was
> installed, without user intervention?

You can't on Android 3.1+.

On Android 3.0 and below, you could use various hacks (e.g., register
for every damn system broadcast) and start up as soon as one of those
gets triggered.

On Android 3.1+, the user must manually launch an activity of yours
before any broadcast receiver will work, including
ACTION_BOOT_COMPLETED. Hence, AFAIK, there is no way to start a
service without user intervention.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment