On Thu, Dec 2, 2010 at 6:23 PM, Rohan <[email protected]> wrote:
> Bump.
> Any tips for me?
I don't think what you literally asked for ("make a backwards
compatible AIDL") is possible.
What should be possible, though, is to support two different AIDL versions.
I have not tried this, so your kilometerage may vary, but here is what
I would try:
Step #1: Create a new AIDL file with a new name to go along with your
existing AIDL file.
Step #2: Create a distinct Intent format for use with bindService() to
request the new AIDL. For example, if you are presently using <action
android:name="com.myfirm.SERVICE" /> to identify your service to other
apps, add a second element like <action
android:name="com.myfirm.SERVICE_V2" />.
Step #3: Create .Stub implementations for each of the two AIDL files,
routing to some common implementation where needed.
Step #4: In onBind(), examine the Intent you get, and based on the
discriminator you introduced in Step #2, return the corresponding
IBinder from Step #3.
This extends indefinitely, so you can be backwards-compatible as long
as you want, deprecating the older AIDL. If you have analytics in your
app, you might consider logging the usage of each AIDL version -- once
an old one becomes unused, announce you are dropping it, then drop it
sometime thereafter, to reduce your code maintenance burden.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
_Android Programming Tutorials_ Version 3.0.1 Available!
--
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