Hacker News new | ask | show | jobs
by dmayle 1234 days ago
I just wanted to correct a little bit of misunderstanding here about how target SDK works (and min SDK).

Having a target SDK e.g. at Android 12 doesn't prevent you from supporting versions of Android before 12, it prevents you from fully supporting Android devices newer* than Android 12.

The target SDK defines what is the minimum feature set that you have access to (and sometimes what you're required to implement). If you target API level 31, you can add all of the latest features (e.g. improvements around network usage to save energy that wasn't present in older SDK versions).

You, as a developer, decide on your "min SDK", which is the lowest level of Android that you're willing to accept. That is determined by how much you're willing to work around missing or buggy features in old SDK versions, something with is really helped out by using AndroidX (née Support Library), which is a shim you install that provides compatible implementations of newer features when your APK is installed on older phones (similar to polyfill on web).

* During the beta of a new target SDK, old phones won't run an app targeting it, this is to prevent people from building and shipping apps against a beta SDK.