2

Is there a way for an Android app to determine its target API level? (Particularly in the case of a JAR library, which cannot influence which apps it is embedded in, while app developers may not be able to change the code of the JAR.)

user149408
  • 5,385
  • 4
  • 33
  • 69

1 Answers1

2

For a given context, call:

context.getApplicationInfo().targetSdkVersion

Same for minSdkVersion, which will give you the minimum SDK version.

user149408
  • 5,385
  • 4
  • 33
  • 69