What exactly are minSdkVersion and targetSdkVersion?

Asked 2 years ago, Updated 2 years ago, 44 views

I'm developing an Android app. I wonder the difference between minSdkVersion and targetSdkVersion.

eclipse android

2022-09-22 22:33

1 Answers

Indicates the minimum API level at which the Android app can run. If the device version is lower than the version declared by the app, the app will not be installed.

It is a field that must be declared when developing an app, and if it is not declared, "1" is selected as the default.

Indicates the target API level of the Android app. If it is not declared, it is considered the same value as minSdkVersion. The concept of 'target API' refers to the API level at which the app was tested during development. Of course, the targetSdkVersion can only be equal to or higher than the minSdkVersion. However, even if the targetSdkVersion is high, the app can also be installed and run in minSdkVersion.

Then when will targetSdkVersion be used?

Of course, as the Android API version goes up, the platform changes little by little. Let's assume the situation below.

App API Level : miSdkVersion : 4 / targetSdkVersion : 7

Platform API level : 10

In this situation, of course, it is not difficult to install and run the app. But what if the API for Android came from version 7 to version 10 and there was a change in the API related to app execution? In this case, the execution of the app is likely to be different from the developer's expectations. Therefore, on the Android platform, you need to enable backward compatibility-related features and run the app. In other words, the field is responsible for informing the Android platform to ensure maximum operability during the initial release.


2022-09-22 22:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.