Vipul Sagare wrote: > After spending few days with Services API, here are some of my > questions. I would appreciate your answers and any leads to blogs/postings. > > I have already gone through API reference and APIDemos for AlarmService, > LocalService, and RemoteService. > > - Are there any good sample applications for each?
See below. > - Wouldn't most applications use Local Service? That is difficult to say in the abstract, though I would not be surprised if more use local services than remote services. > - What are some of the applications which would be good candidate for > remote services but not for local services? Here are three off the top of my head: 1. You want third-party programs to use the service (even if you are using it locally, it needs to support AIDL interfaces and such for use remotely) 2. You are reusing a service from a third-party program 3. You want part of your application to run with different permissions than another part of your application (e.g., firewalling off certain sections), and so you split part of it out into a remote service > -Is there any other resource apart from API reference, APIDemos and dev > guide for this topic that one would recommend? (Some of the blogs are > a bit outdated) You mean besides (*cough*) various Android books? ;-) In all seriousness, services have not received quite as much attention as activities. There are probably good samples out on anddev.org, and you might consider poking through code.google.com or github's Android projects to see if anything strikes your fancy. > -To start an Activity from service, the use of Notification with > PendingIntent is the "best and only" way. Is that correct? Best, yes. Only, no. AFAIK, you can call startActivity() from a service, though your users may threaten you with bodily harm if you do so, since you might be interrupting them in the middle of something else they are doing. -- Mark Murphy (a Commons Guy) http://commonsware.com Warescription: Three Android Books, Plus Updates, $35/Year --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---