简体   繁体   English

要设置的值:“Minimum Required SDK”,“Target SDK”和“Compile with”

[英]What value to set for: “Minimum Required SDK” , “Target SDK” & “Compile with”

I know that there are many question on this, and I also read this page . 我知道有很多问题,我也读过这个页面 However, I am still confused about the exact choices. 但是,我仍然对确切的选择感到困惑。

If I have a mobile phone that runs Android 2.3.6 如果我有一部运行Android 2.3.6的手机

I know that the Minimum Required SDK should be the lowest version of Android that my app supports. 我知道Minimum Required SDK应该是我的应用支持的Android的最低版本。 So for example I will choose Android 2.2 or less than that value, say Android 1.5 例如,我会选择Android 2.2或低于该值,比如Android 1.5


The confusing parts Target SDK and Compile with 令人困惑的部分Target SDKCompile with

I have installed these below: (there is no Android 2.3.6 available in the SDK manager) 我在下面安装了以下内容:( SDK管理器中没有可用的Android 2.3.6

Android 4.2.2 (API 17) Android 4.2.2(API 17)
Android 3.0 (API 11) Android 3.0(API 11)
Android 2.3.3 (API 10) Android 2.3.3(API 10)
Android 2.2 (API 8) Android 2.2(API 8)

Is the Target SDK should be set to the maximum which is Android 4.2.2 , irrespective to what my mobile phone uses; Target SDK是否应设置为Android 4.2.2的最大值,而不管我的手机使用的是什么; which is Android 2.3.6 ? 哪个是Android 2.3.6

choosing Android 4.2.2 will cover all phones below it? 选择Android 4.2.2会覆盖它下面的所有手机吗? is that right? 是对的吗?

Or 要么

Is it should be set to the exact/nearest value as my phone. 它应该设置为我的手机的确切/最接近的值。 Here the available one is Android 2.3.3 ? 这里有可用的Android 2.3.3吗? But not exceed my mobile phone Android 2.3.6 但不要超过我的手机Android 2.3.6


Is Compile with must be set to the maximum Android 4.2.2 or what? Compile with必须设置为最大的Android 4.2.2或什么?

Is the Target SDK should be set to the maximum which is Android 4.2.2, irrespective to what my mobile phone uses; 目标SDK是否应设置为Android 4.2.2的最大值,而不管我的手机使用的是什么; which is Android 2.3.6 ? 哪个是Android 2.3.6?

That is up to you, but its always recommended to use the latest sdk as a target. 这取决于你,但它总是建议使用最新的sdk作为目标。

It just says that the application will work between min and target sdk, but tested for the target sdk alone, so if there are any compatible settings system must take care of it. 它只是说应用程序将在min和target sdk之间工作,但仅针对目标sdk进行测试,因此如果有任何兼容的设置,系统必须处理它。

choosing Android 4.2.2 will cover all phones below it? 选择Android 4.2.2会覆盖它下面的所有手机吗? is that right? 是对的吗?

Your app always covers from Min-SDK to Max-SDK. 您的应用始终涵盖从Min-SDK到Max-SDK。 If the Min-SDK is 1 and Max-SDk is not set, then your app supports all the APIs. 如果Min-SDK为1且未设置Max-SDk,则您的应用程序支持所有API。

Is it should be set to the exact/nearest value as my phone. 它应该设置为我的手机的确切/最接近的值。 Here the available one is Android 2.3.3? 这里有可用的Android 2.3.3吗? But not exceed my mobile phone Android 2.3.6 但不要超过我的手机Android 2.3.6

Must be the latest SDK 必须是最新的SDK

Is Compile with must be set to the maximum Android 4.2.2 or what? 是编译必须设置为最大的Android 4.2.2或什么?

Its just your choice of which SDK to compile your app with. 它只是您选择使用哪个SDK来编译您的应用程序。 But better go with the Target-SDK which in turn is the Latest. 但最好使用Target-SDK,而后者又是最新的。

I've always set my Compile with to the be same as Target SDK . 我总是将我的Compile with设置为与Target SDK相同。

Target should be what you have tested and architected your app to handle. 目标应该是您测试过的并构建您的应用程序以进行处理。 As Android evolves API behaviors can change, like the Serial/Parallel/Serial nature of default AsyncTask (see: Running multiple AsyncTasks at the same time -- not possible? and http://commonsware.com/blog/2012/04/20/asynctask-threading-regression-confirmed.html ) which depended on your app's Target API and on the device API. 随着Android的发展,API行为可能会发生变化,例如默认的AsyncTask的串行/并行/串行性质(请参阅:同时运行多个AsyncTasks - 不可能?http://commonsware.com/blog/2012/04/20 /asynctask-threading-regression-confirmed.html )取决于您的应用的Target API和设备API。 Fun times for us discovering it then. 有趣的时间让我们发现它。

In addition various APIs get depreciated as well so going with the most recent API forces you to only use what being currently maintained. 此外,各种API也会被折旧,因此使用最新的API会强制您仅使用当前维护的API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM