Here's a good writeup on how to do this.

http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html

The benefit of doing it this way vs leaving the min/target SDK at the
lowest level and using reflection is that by setting the target SDK to
the higher level you can include XML elements/attributes, in the
resource files, that are introduced in the later API levels.  Using
reflection does not allow this, AFAIK.  Note that you just have to
make sure to not use those newer resources when running against an
older API level, but that's really the same as knowing to not use the
newer API calls when running against older API levels.

Don

On Apr 12, 4:01 pm, Jake Colman <col...@ppllc.com> wrote:
> My application is targeted for v1.6 and greater.  There is, however, one
> feature that I'd like to implement that would work only on v2.2.  How
> does one write and publish code that will work on v1.6 yet make use of
> v2.2 APIs if they are available?  How does one properly set up the
> Manifest to indicate that the app runs on v1.6 but would prefer v2.2?  I
> read up on MinSDK but I am not clear on how it works for this purpose.
> An RTFM answer is fine if appropriate.
>
> Thanks.
>
> --
> Jake Colman -- Android Tinkerer

-- 
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

Reply via email to