On Wed, Mar 16, 2011 at 3:59 PM, Ramsay Domloge <[email protected]> wrote: > I would like to counter some of your suggestions by playing Devil's > advocate, if I may.
OK. > "Most services do not expose intent filters." > > OK, interesting - so those that do are presumably happy to be started by 3rd > parties? Not necessarily. Developers sometimes screw up, putting in intent filters that are not needed. Some may expect certain extras and will crash if they are not provided. Some may expect things to be done in a certain sequence. And so on. > However, how would a program dynamically find my Service and 'know' that it > can be used in this way? It wouldn't. There are no generic actions in the Android SDK for services equivalent to, say, ACTION_VIEW or ACTION_SEND for activities. > For Activities we have the aformentioned > Action_Main and Category_Launcher that flag the Activity being runnable by > 3rd parties - is there a Service equivalent? Not presently. The Android architecture supports the concept, at least to some degree, but there's nothing in the SDK that uses it, and I'm not aware of any third parties using it. > "Please do not start services just because you feel like it." > > OK. But you hopefully agree that there are scenarios where starting a > 3rd-party service is desirable? See MusicPopup above. Yes, but generally only if the third-party developer documents it. > "This may come as a shock to you, but services are designed to be started > (and hopefully stopped) by their own applications" > > Harsh, Yeah, sorry, been a bunch of posts today that have me on edge. > and not strictly true - Services should be able to stop at any time, > since Android may close them when resources are under pressure. Yes. However, you want to start services at any time, and that may or may not be kosher. > Finally, I can add a 'Service discovery' mechanism to my new app which only > finds Services that are free to be started and stopped by 3rd parties. So long as it's opt-in, sure. Whatever floats your boat. I'll be surprised if you get any takers, though. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- 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

