How to start a background service on install

by klavin » Sat, 23 Oct 2010 01:23:34 GMT


Sponsored Links
 I have an app which runs as a background service only. I'l like it to
start up when its installed.
As its just a background service it doesnt show up on the pane of
installed apps. So there is no way for the user to manually start it.
I've already regietered for the BOOT_COMPLETED intent which works but
I dont want the user to have to power off the phone after the app has
been installed, just so as they can start it.

I've looked at the following intents: ACTION_PACKAGE_ADDED/CHANGED/
REPLACED/RESTARTED/INSTALL, ACTION_SCREEN_ON/OFF, ACTION_USER_PRESENT,
ACTION_TIME_TICK,
but it doesnt seem that you can register to listen for them from my
manifest.

Any idea how I can start my background service without a power off/on?
Thanks

--



How to start a background service on install

by Mark Murphy » Sat, 23 Oct 2010 01:31:48 GMT


 


That is not supported. Please let the user choose when to start up
your application.


That is an invitation to a whole lot of one-star ratings on the
Market. By most reports, users do not like installing which have no
icons in the launcher.


Then add an activity that adds value to your application, and along
the way sets up the alarm for AlarmManager for your periodic
background work. For example, you could allow the user to change the
frequency of the background work (including "never") in the form of a
PreferenceActivity.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

--


Sponsored Links


Other Threads

1. Create QQ Group (28759870)

i create a qq group for android developer.
Welcome , join us!
--~--~---------~--~----~------------~-------~--~----~

2. How do i layout buttons without horizontally without padding between them?

I am trying to layout buttons 1 | 2 | 3 etc.. without any padding
between the buttons? I am sure its something very easy and i can't
seem to find out how.

--~--~---------~--~----~------------~-------~--~----~

3. on testing a webserver on the android emu

4. Why cant apps be downloaded to an external SD card??

5. Why cant apps be downloaded to an external SD card??

6. Europeans after the G1

7. Using PAD files for Android application releases