简体   繁体   English

安装Android SDK时应选择哪个Android平台?

[英]Which Android platform to choose when installing the Android SDK?

After installing the Android SDK, I noticed that I need to choose the platform, ie Android 1.3 all the way upto 4.1 individually. 安装Android SDK之后,我注意到我需要选择平台,即Android 1.3一直到4.1。

My question is, does this mean if I create an app, I have to create it on each and every platform individually? 我的问题是,这是否意味着如果我创建一个应用程序,就必须在每个平台上分别创建它?

I am a total noobie to Android development... 我完全是Android开发的入门者...

It's basically recommended to choose lowest API you plan to support in your application (unless you know you got reasons to have it set differently). 基本上建议您选择计划在应用程序中支持的最低API (除非您知道有理由对其进行不同的设置)。 For example if your app is for Honeycomb and newer versions only, then select SDK 3.0 to get access to all the features newly introduced in HC which you may want to use. 例如,如果您的应用仅适用于Honeycomb和更高版本,则选择SDK 3.0以访问您可能想使用的HC中新引入的所有功能。 But if your application shall run also on older devices with older versions of Android like 2.0.1 (or even 1.6 if you really need) set this to lowest API desired. 但是,如果您的应用程序也应在运行Android 2.0.1版(如果需要的话甚至是1.6版)的旧设备上运行,则将此值设置为所需的最低API。 So, now that rule is sufficient for you and lets you ensure you accidentally won't use any API method not supported on all platforms you target to which would lead your application to crash. 因此,现在该规则已足够满足您的需要,并可以确保您意外地不会使用所有目标平台上都不支持的API方法,这将导致应用程序崩溃。

If not sure what API you want I suggest go for 2.x and simply ignore any older Android versions as it is basically pointless, according to platform version breakdown statistics published by Google . 根据Google发布的平台版本细分统计信息 ,如果不确定自己想要的API是什么,我建议您选择2.x,而忽略任何较旧的Android版本,因为它基本上毫无意义。

I recommend you read this SDK article on how to define minSdk and targetSdk elements to match your requirements. 我建议您阅读此SDK文章 ,了解如何定义minSdktargetSdk元素以满足您的要求。

No. You can specify a minimumsdkversion for your app in your Android Manifest, so that it will support all the platforms from this API Level up to the newest platform. 不能。您可以在Android Manifest中为您的应用程序指定一个minimumsdkversion ,以便它支持从此API级别到最新平台的所有平台。

See here for more information. 有关更多信息,请参见此处

Edit:Of course you can't use some newer API functions in older SDKs, without the support lib, or some third party libraries(eg the actionbar, fragments, expandable notifications etc.) 编辑:当然,如果没有支持库或某些第三方库(例如,动作栏,片段,可扩展的通知等),您将无法在较旧的SDK中使用某些较新的API函数。

Take a look here Basically it means that your app is meant to be used with this android version (but you can support higher or lower version too). 在这里看看基本上这意味着您的应用程序应与此Android版本一起使用(但您也可以支持更高或更低的版本)。 I strongly encourage you to read the documentation to understand better how the all thing works. 我强烈建议您阅读文档,以更好地了解一切。

A simple answer is no. 一个简单的答案是不。

When you are developing an application you have the provision to specify which is the minimum platform that you are developing for. 在开发应用程序时,您可以指定要开发的最低平台。 The newer SDk will have more features which might not be available in old ones so care must be taken to see that your app is available for a specific platform. 较新的SDk将具有更多旧功能可能不可用的功能,因此必须注意确保您的应用可用于特定平台。

I would suggest that you bookmark the developer.android.com and stakoverflow.com websites, they will be very handy :) 我建议您为developer.android.com和stakoverflow.com网站添加书签,它们将非常方便:)

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

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