When an APK is generated with a given API Level, is there a way to know which API level was used for compiling just having the APK file?
The minSdkVersion does not necessarily match the API Level used for compiling the project, it is just a note for the Android installer to block the app if minSdkVersion > current version
In Android studio 2.3, Build -> Analyze APK -> Select the apk that you want to decompile . You will see it's source code.
Drag an APK or app bundle into the Editor window of Android Studio. Switch to the Project perspective in the Project window and then double-click the APK in the default build/output/apks/ directory. Select Build > Analyze APK in the menu bar and then select your APK or app bundle.
Tap the "Software Information" option on the About Phone menu. The first entry on the page that loads will be your current Android software version.
Android api level 19 means the android os version (kitkat). It contains the standard android packages(from Android Open Source Projects). But the google api 19 is the android api 19+ google api's like google settings and other packages provided by google.
This is another way to get the targetSdkVersion
and the versionCode
of my application:
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
int versionCode = packageInfo.versionCode;
int targetSdkVersion = packageInfo.applicationInfo.targetSdkVersion;
}
catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, e.getMessage());
}
using Android Studio
, the values are defined into my build.gradle
file
defaultConfig {
applicationId "com.tuna.hello.androidstudioapplication"
minSdkVersion 9
targetSdkVersion 22
versionCode 12
versionName "1.0"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With