Thoroughly understand how to set minSdkVersion, targetSdkVersion, and targetsdkversion

Source: Internet
Author: User

Thoroughly understand how to set minSdkVersion, targetSdkVersion, and targetsdkversion

I believe many people do not understand minSdkVersion and targetSdkVersion. I have read many articles on the Internet about the differences between the two, until I see Android Min SDK Version vs in stackOverFlow. after this article, I finally figured out how to set minSdkVersion and targetSdkVersion. Now I will share it with you.

In short, this article aims to differentiate minSDK and targetSDK, which are equivalent to a range. You can use the latest API and the coolest new features in targetSDK, however, you have to be backward compatible with the minSDK to ensure that all devices in this range can run your app normally. In other words, if you want to use the new features launched by Android, but this is not necessary for your app, you can set the targetSDK to the SDK version of the new features you want to use, set minSDK to a lower version to ensure that everyone can use your app.

For example, if you want to add a large number of gesture operations to your app (sdk 7 is introduced), these gesture operations can be replaced by buttons, menus, etc, in this case, the gesture operation is an additional bonus feature, not a required feature. Therefore, you need to set the targetSDK to 7, set minSDK to 3 (for example, no one is using such an old device now) so that even old users can use your app. All you need to do is to judge the version in the Code. If it is a version greater than or equal to 7, use the gesture operation, and replace it with the button in a version earlier than 7, in this way, users with new mobile phones can experience the cool new features in your app.

Another example: If you want to add the Material Design of Android 5.0 to your project, some users may upgrade to 5.0 and use your new features, some users have too old mobile phone hardware and do not support upgrading to 5.0. Unless they change their mobile phones, you have to perform backward compatibility for them, so as not to lose these users, in this way, set targetSDK to 21 and minSDK to 8.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.