The formally correct thing is to make the functionality be on a new interface that the app explicitly requests. (The interface can also contain all of the original functionality for simplicity if you want.) This is basically the COM interface versioning approach.
The quick and dirty approach is to take advantage of knowing that the current aidl compiler assigns an interface's methods their identifiers in the order they are declared, so you can add new methods to the end without changing the identifiers for the existing ones. On Thu, Dec 9, 2010 at 5:40 PM, Mark Murphy <[email protected]> wrote: > On Thu, Dec 9, 2010 at 8:33 PM, Rohan <[email protected]> wrote: > > Adding new functions following steps 1-3 could be done in 2 ways: > > 1) Copy all the existing functions to the new aidl, and calling > > through to the same functions as the orignal Stub implementation was > > for existing functions. > > 2) Adding only new functions to the new aidl, and binding to the > > service through both aidl's. > > > > You seem to be suggesting option 1; so is there any reason I wouldn't > > want to use option 2? > > You are putting more burden on the reuser. Now they have to bind twice > to get two IBinders, one for the original API and one for the > additional stuff. > > > I will also add a wrapper class over my aidls which each application > > will call in to, and isolate the fact that the aidl's are changing > > across versions (app developers just see an updated API in the wrapper > > class). > > Ah. If you are going this route, then perhaps the additional > complexity can be hidden from most of the reusers. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > Android Training in Atlanta: http://bignerdranch.com/classes/android > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

