I think isolating the 2.0 calls to a separate class will work, but in away this will become almost as unwieldy as the reflection method (although I guessing will have some performance benefit over reflection). Please post what you find from your experiments.
Thanks again, Nic On Wed, Nov 18, 2009 at 1:37 PM, Mark Murphy <mmur...@commonsware.com>wrote: > Nic Strong wrote: > > I see your point. I am not a java expert but I am guessing there maybe > > some conditions where the class loader my try to load the missing class > > even though the code is not going to be called? > > I don't know the granularity of the classloading. Certainly if you mix > Android 2.0 APIs with older APIs, and just try using branching at that > point, it'll fail. Isolating it into separate classes may work, though > -- thought about that but didn't try it in my earlier multiple-version > experiments. > > > But it is going to become > > very unwieldy as we support more of the 2.0 apis (e.g > > AccountManager/ContactsContract). > > Indubitably. I'll be looking at the new Contact APIs tomorrow, and I'll > try to run some experiments with your proposed technique. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 1.0 In Print! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en