您应该选择什么构建目标和最低 SDK 版本?
嘿,我正在构建一个带有文本、网址、图片和一些按钮的基本应用程序。 当您创建一个新项目时,您通常选择什么构建版本?最高的,2.2? 您选择的最低 SDK 版本是多少?还有2.2?或者最低的可能?
我有点困惑什么对所有客户来说都是最好的
- 谢谢!
Hey, I'm building just a basic app with text, urls, pictures, and some buttons.
When you create a new project what build version do you usually choose? The highest, 2.2?
And also what min SDK version do you choose? Also 2.2? or the lowest one possible?
I'm a little confused by what would be best for all customers
-Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该选择您想要支持的内容。
如果您想要最新的 API 功能,请选择 2.2(或很快选择 2.3)。但如果您想包含所有可能的手机,则最低目标需要低至 1.5。问题是,如果他们使用 1.5 设备,您必须避免进行仅存在于更高版本的 Android 中的 API 调用。
You should choose what you want to support.
If you want the latest API features, choose 2.2 (or soon 2.3). But if you want to include all possible phones, you need to go as low as 1.5 for the min target. The catch is that if they are using a 1.5 device you have avoid making API calls that only exist in a later version of Android.
这仅取决于您想做什么。如果您想支持多个 Android 版本,请按照 Falmarri 所说的操作。选择您希望
minSDK
支持的最低 API 版本,并选择您为buildTarget
定位的 API 版本。但是,您必须记住,对于不同的 API 版本,您可能必须以不同的方式处理某些内容,这可能需要 if-else 块检查 API 版本。这并不难做,也不是什么神奇的事情,只需记住这一点并检查您使用的类和方法的参考页即可。
It just depends on what you want to do. If you want to support multiple Android versions then do what Falmarri said. Select the lowest API version you want to support for
minSDK
and choose the API version you are targeting for thebuildTarget
.However you have to keep in mind that you might have to handle certain stuff in a different way for different API versions which might require if-else blocks checking for the API version. It is nothing hard to do nor something magic just keep it in mind and check the reference page on the classes and methods you use.
我的两分钱的价值是我也在调查这个问题。除了本页之外,我还发现以下官方统计数据很有帮助。
http://developer.android.com/resources/dashboard/platform-versions.html
此外,如果您已经在市场上发布了应用程序,您可以获得有关受众如何看待您的特定应用程序的数据,这可能会帮助您进行选择。
从个人角度来看,在撰写本文时,我将把最低版本设置为 2.2,因为这是编写使用 OpenGL ES 2.0 的应用程序所需的最低 API 级别。
(有点偏离主题,但为了限定有关 OpenGL ES 2.0 的声明 http:// /developer.android.com/resources/tutorials/opengl/opengl-es20.html)
My two cents worth is that I am also investigating this question. With the exception of this page, I also found the following official statistics to be helpful.
http://developer.android.com/resources/dashboard/platform-versions.html
Also, if you already have applications published in the market you can get data on how your specific application is perceived by your audience, this may help you to choose.
From a personal perspective, at the time of writing I am going to set my minimum version to 2.2 as this is the minimum API level required to write applications that use OpenGL ES 2.0.
(slightly off topic, but to qualify the statement about OpenGL ES 2.0 http://developer.android.com/resources/tutorials/opengl/opengl-es20.html)