DulcetTone wrote:
> How is an app supposed to be able to use an underlying service whose
> name does not change, but whose AIDL file has changed from one Android
> version to another?

IMHO, ideally the service uses a different intent filter per version of
AIDL it supports, and you bind to the service with the appropriate Intent.

For example:

<service android:name=".BshService">
        <intent-filter>
                <action 
android:name="com.commonsware.android.advservice.IScript" />
        </intent-filter>
        <intent-filter>
                <action 
android:name="com.commonsware.android.advservice.IScript2" />
        </intent-filter>
</service>

where in onBind(), BshService would inspect the incoming Intent, look at
the action, and return an appropriate binder.

Of course, each binder will need separate AIDL, defining a separate
interface, as you noted.

This way, the service supports both old and new clients, and old clients
can be ignorant of the existence of the new interface.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Consulting/App Development: http://commonsware.com/consulting
-- 
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