My Question: Can I support an older api and use functions of a newer api if available?
My Situation: I’m building a simple app that I want to support some advanced functions with the UI if available. But the API level I’m supporting is 13 so I can support Android 3.2. Specifically, I want to use the View.SYSTEM_UI_FLAG_* variables, but those are not available in api level 13.
Yes, you can check that at runtime:
and you have to set
android:targetSdkVersionof your app’s Manifest to highest API version you want to support, otherwise you will not be able to build it.Please see this
<uses-sdk>related article.