Thanks Mark Ok so for the first issue (stopping service) I will try your suggestion. For second question, when my activity starts there is an involved process of initializing bunch of items which requires few seconds. Hence I wanted to initialize these via a service on BOOT_COMPLETE (working for me already) or on the package installation (which I am trying to figure out). This way when the activity is started by the user there wont be any wait.
~Nick On Fri, Dec 4, 2009 at 12:50 PM, Mark Murphy <mmur...@commonsware.com>wrote: > > I had a similar issue. What I wanted to do was to run a short service > > on boot up and initialize a few items and then stop the service. I > > understand that its not a good idea to leave the service running for > > the entire life-cycle of the phone. I was able to achieve this by > > creating a broadcast receiver and starting my service (and do some > > post delay items). I still need to figure out how to stop the service > > part. Please chime in if any one has any comments on this. > > I do not know what you mean by "how to stop the service part". If a > service wants to stop itself, it can call stopSelf(). > > > Can any one point to another strategy for starting up my > > service after my package installation? > > Let the user start it by launching your activity. > > > An alternative would be to > > "force phone re-boot" after the package is installed (obviously after > > giving the choice to the user if he wants to continue or not) but I > > dont know how to force that either. Any ideas how to achieve that? > > You can't reboot the phone programmatically, unless you are part of the > firmware, AFAIK. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com > Android App Developer Books: http://commonsware.com/books.html > > > -- > 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+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en