SDK_INT
has been the standard way for checking which API version an Android device is running. However, there are several problems with this approach: the conditional checks are unclear, are often duplicated without a clear meaning, and are very difficult to unit test. In this video, I’ll show you how to easily cut through this messy, pitfall-prone process with a simple, 2-step solution.
Companion code for this YouTube video: https://youtu.be/IRuzVNu0Q84