我应该为compileSdkVersion,minSdkVersion和targetSdkVersion设置什么? [英] What should I set for compileSdkVersion, minSdkVersion, and targetSdkVersion?

查看:80
本文介绍了我应该为compileSdkVersion,minSdkVersion和targetSdkVersion设置什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我担心应该将compileSdkVersionminSdkVersiontargetSdkVersion设置为什么.

I am concerned about what should I set the compileSdkVersion, minSdkVersion, and targetSdkVersion to be.

  1. 我首先要担心的是,如果我将compileSdkVersion设置为现在的最新值23,那么旧设备将能够运行它吗?

  1. My concern first of all is that if I set the compileSdkVersion to be 23 which is the latest right now, will older device be able to run it?

我怎么确切知道我的minSdkVersion应该是什么,以确保运行较低api或版本的手机无法访问它(我不想将最低sdk设置得过高,因为那样会阻止可能运行该应用程序的手机)?

How do I exactly know what should my minSdkVersion be in order to make sure that phone running lower api or version be unable to access it (I don't want to set the minimum sdk too high because that would block phone that could potentially run the app)?

我应该如何设置targetSdkVersion?

推荐答案

我将compileSdkVersion设置为23,这是现在的最新值,旧设备将能够运行它吗?

I set the compileSdkVersion to be 23 which is the latest right now, will older device be able to run it?

是的. compileSdkVersion本身与哪些设备可以运行和不能运行您的应用程序无关.通常,您将其设置为Android SDK的最新版本.

Yes. compileSdkVersion on its own has nothing to do with what devices can and cannot run your app. Usually, you set this to be the latest version of the Android SDK.

我如何确切知道我的minSdkVersion应该是什么,以确保运行较低api或版本的手机无法访问它?

How do I exactly know what should my minSdkVersion be in order to make sure that phone running lower api or version be unable to access it?

通常,当您尝试使用比您的minSdkVersion更新的产品时,开发工具会即时向您发出警告.您可以运行完整的Lint检查以定期重新确认.

Frequently, the development tools will warn you on the fly when you try using something that is newer than your minSdkVersion. You can run a full Lint check to reconfirm periodically.

我应该如何设置targetSdk?

How should I set my targetSdk?

在没有任何其他特殊原因的情况下,我通常在创建项目时(例如现在为22或23)选择最新的或最新的值. targetSdkVersion有助于向后兼容,通常我的描述是这是您在编写代码时所考虑的Android版本".

In the absence of any particular reason to choose something else, I usually pick the latest or next-to-latest value at the time I create my project (e.g., 22 or 23 now). targetSdkVersion helps with backwards compatibility, and usually my description is "it's the version of Android that you were thinking of at the time you were writing the code".

这篇关于我应该为compileSdkVersion,minSdkVersion和targetSdkVersion设置什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆