Closed ashughes closed 11 years ago
One should target as high as possible. There is no need in targeting a lower version.
No, you should target the lowest possible version so you avoid using APIs that aren't available in older versions. If newer APIs are desired, then the target API should be increased and those features should be wrapped in API level checks for compatibility (and optionally provide backwards compatible functionality).
From http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#considerations under Selecting a platform version and API Level:
When you are developing your application, you will need to choose the platform version against which you will compile the application. In general, you should compile your application against the lowest possible version of the platform that your application can support.
That's outdated, check the Android Developers Relations team for that.
There are now Lint checks that check if you are using something that is not supported.
Well if that's no longer recommended I'd love to see who/where it says that. It would be nice if they updated the developer site. :)
You are totally right about the Lint checks (which are really nice and helpful), although not everyone checks Lint to see them (I don't remember if they're Lint warnings or errors).
I am busy right but I will look it up, I think Reto Meier has said it in his videos. Those Lint checks are automatic in the last ADT version and show up as errors.
The target must be as high as possible. The proof is that when you create empty project, the default target is the maximal SDK version installed. In my case it's 17.
API level 11 is the lowest SDK this library project can build against.