IntentServices are awesome. I haven't used ResultReceiver yet, though. I have just used android.os.Messenger in an IntentService, and that works nicely.
On Wed, Nov 10, 2010 at 4:49 PM, Federico Paolinelli <[email protected]> wrote: > I was looking to existing source code to get some inspiration, and I > came across the google io 2010 schedule app. > > They still use an intent service to perform the calls, but they use > another way to fetch the result of the webservice interaction, which > is sending to the intent service a parceled ResultReceiver to be > called to be notified of the result. > > I am not sure that this approach is better compared to returning the > result bundled in a broadcast (any ideas?), but in any case I think I > will go with the intent service in order to save some resources. > > Federico > > On Wed, Nov 10, 2010 at 8:12 AM, Federico Paolinelli <[email protected]> > wrote: >> On 10 Nov, 00:58, Mark Murphy <[email protected]> wrote: >>> On Tue, Nov 9, 2010 at 6:52 PM, Federico Paolinelli <[email protected]> >>> wrote: >>> > And a more general question: is the bind mechanism suitable for one >>> > shot services, or it just make sense for persistent services? >>> >>> To me, that is a bit like asking if a wheel is suitable for bananas, >>> or does it just make sense for apples. :-) >> >> :-(( >> >>> >>> Bind if: >>> >>> -- You are going to be around for the duration of the operation >>> -- The service needs to be around >>> -- You need a rich API >>> >>> For example, if you have a Service that is providing a local API >>> around a synchronous Web service, binding is a fine solution. >>> >> >> I think it still depends on how many calls you are going to do. I >> mean, even in case of a synchronous web service, this may be >> implemented with an intent service (with the overhead of the >> conversion to intents back and forward for the query parameters and >> the result). In this way you can still save resources. >> >> What keeps bugging me is that you never really __need__ to be around, >> but on the other hand my laziness pushed to the rich api solution. >> >> >> >> >>> > What happens if I call the startService method but the service is >>> > already active? Will it start another service, or will it call the >>> > onStartCommand of the same service? >>> >>> The latter. There cannot be more than one copy of a service running at a >>> time. >>> >>> -- >> >> >> Thanks as always, >> >> Federico >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > > -- > -------- > Federico > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- 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.2 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

