> What's the difference between 'bindService()' and 'startService()'?

Well, that's a bit long to explain in an email.

startService() just starts the service. bindService() may start the
service (if needed and if you provide the BIND_AUTO_CREATE flag), and
gives you access to the service's "binder" for calling methods on it.
bindService() is reference counted, so the service will stay running until
all clients are unbound. startService() is not reference counted, so a
call to stopService() will stop the service directly.

> Can there be only one instance of the service?

Yes.

> And if so, does that
> mean that calling bindService() will find that service if it's already
> up and running?

Yes. Or, specify the BIND_AUTO_CREATE flag, and bindService() will start
the service if it not already started.

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

Reply via email to