I have a project that is just using Android 1.5 for programming, but with the proliferation of other handsets and some cool features in Android 2.2, we\'d like to support th
we'd like to support the features without losing support for 1.5 or forking a new code base. Is it possible to do with Android SDK?
Sure. The techniques have been around for about a decade or so.
Option #1: Use reflection to access new classes (or new methods of existing classes) at runtime. See here for an example.
Option #2: Use conditional class loading, by creating an interface plus two implementations (one for an older API, one for a newer API), and loading the right implementation at runtime. Since the newer implementation will not be loaded on a older device, the fact that the newer implementation uses classes or methods that the older device lacks will not pose a problem. See here for an example.