Re: [android-developers] Re: Same servicein multiple APKs, only want "best one" to launch

2009-12-20 Thread Dianne Hackborn
Yeah, that is the typical way to this. For example it is exactly how the launcher presents and runs applications, except it is looking for activities (with action MAIN and category LAUNCHER). You can find the package and class names in the ServiceInfo that you get back, to construct a ComponentNa

[android-developers] Re: Same servicein multiple APKs, only want "best one" to launch

2009-12-19 Thread Watcher
Hi, I have read your post already which is why I was playing around with the packagemanager. I suppose that is the workable solution you are mentionning ? If that is so then my question to Diane remains : how do I launch a service explicitly, not using a string action, when its class is in another

[android-developers] Re: Same servicein multiple APKs, only want "best one" to launch

2009-12-18 Thread whitemice
I already had this discussion and was able to put together a workable solution. I bloged it here: http://tinyurl.com/9hwdva Regards Mark -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developer

[android-developers] Re: Same servicein multiple APKs, only want "best one" to launch

2009-12-18 Thread Watcher
Using android:priority is an interesting idea ! I didn't even know it was there. Reading from the docs, I see that "When an intent could be handled by multiple activities with different priorities, Android will consider only those with higher priority values as potential targets for the intent." a

[android-developers] Re: Same servicein multiple APKs, only want "best one" to launch

2009-12-18 Thread Watcher
Hi Diane, > something else if you want.  Then when you bind to the service, set an > explicit component in the intent for the service you have picked. How would I do that if the service is implemented in another APK ? I can't call new Intent(Context context,Class clazz) in this case because clazz

[android-developers] Re: Same servicein multiple APKs, only want "best one" to launch

2009-12-17 Thread John Seghers
Here is one possibility: use ordered BroadcastReceivers with android:priority attributes to determine which service is newest. Each APK has its copy of the Service and a BroadcastReceiver. The intent-filter for the BroadcastReceiver has the android:priority attribute. Upon each release across all