Those same things apply to the local service sample.  That sample is still
binding; it is just taking advantage of the fact that the returned IBinder
is implement in its same process so can be cast to a concrete class.

On Mon, Nov 1, 2010 at 12:26 PM, jotobjects <jotobje...@gmail.com> wrote:

> Thanks for the feedback.
>
> Two reasons I found (correct me if I am wrong) for using an IBinder
> are -
>
> - A Service bound to a foreground Activity has a higher chance of NOT
> being stopped.
>
> - The bindService method provides assurance that the Service has
> started.
>
> On Oct 29, 6:18 pm, Dianne Hackborn <hack...@android.com> wrote:
> > On Fri, Oct 29, 2010 at 2:07 PM, jotobjects <jotobje...@gmail.com>
> wrote:
> > > So that makes me wonder if there are reasons why the Activity cannot
> > > just call methods on the Service directly and vice versa, once you get
> > > references to the two objects.  What is the role of IBinder that is
> > > better than plain object references?
> >
> > You certainly can, as spelled out in the Service doc:
> >
> > http://developer.android.com/reference/android/app/Service.html#Local...
> >
> > (And note ability to do this is not because they are called by the same
> > thing, but because they are running in the same process.)
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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

Reply via email to