简体   繁体   English

我应该为哪个版本的 Android 开发?

[英]What version of Android should I develop for?

How should I make the choice ?我应该如何做出选择? What are the parameters I should take into account ?我应该考虑哪些参数?

Have a look at Android versions market share .看看Android 版本的市场份额 I would develop for 1.6+.我会为 1.6+ 开发。 If you will realize in the middle of development that you want some API feature from newer version, you will have 3 choices:如果您在开发过程中意识到您需要较新版本的某些 API 功能,您将有 3 种选择:

  1. Don't use that feature不要使用该功能
  2. Detect Android version from the app and then decide what to do从应用程序中检测 Android 版本,然后决定要做什么
  3. Change required Android version in your manifest file and project settings在清单文件和项目设置中更改所需的 Android 版本

If possible, you should support the oldest Android version still in widespread use.如果可能,您应该支持仍在广泛使用的最旧的 Android 版本。 That would be 1.5.那将是 1.5。 If you need features from later versions, you might consider requiring newer versions, but if you can do your work on the oldest version still available, you should to increase the number of people who are able to use your app.如果您需要更高版本的功能,您可能会考虑要求更新版本,但如果您可以在仍然可用的最旧版本上完成工作,您应该增加能够使用您的应用程序的人数。

The Oldest version that supports all the functionality your application requires.支持您的应用程序所需的所有功能的最旧版本。

For example: Your app needs multitouch?例如:您的应用需要多点触控? Target version 2.1目标版本 2.1

My application doesn't need any functionality introduced in newer versions, so I target 1.5我的应用程序不需要新版本中引入的任何功能,所以我的目标是 1.5

I agree with the answers posted above, and I would add that on the android API reference site, most of the time the minimum API level is specified ( http://developer.android.com/reference/android/package-summary.html ).我同意上面发布的答案,我会在 android API 参考站点上添加,大多数情况下指定了最低 API 级别( http://developer.android.com/reference/android/package-summary.html )。 You can have a look at this page to identify the Android version associated with a given API level: http://developer.android.com/guide/appendix/api-levels.html您可以查看此页面以识别与给定 API 级别关联的 Android 版本: http : //developer.android.com/guide/appendix/api-levels.html

Personally, I develop everything for 2.1.就个人而言,我为 2.1 开发了一切。 There are only a handful of devices that still run <2.0 and most of those people have already put custom roms on them already.只有少数设备仍然运行 <2.0,其中大多数人已经在上面安装了自定义 rom。 I know it kind of screws people with older phones, but I don't like the idea of crippling my app just to make it backwards compatible.我知道这会让使用旧手机的人感到厌烦,但我不喜欢为了使其向后兼容而削弱我的应用程序的想法。

Also I feel like developing for >2.0 encourages people to upgrade their phones =P我也觉得为 >2.0 开发鼓励人们升级他们的手机 =P

@Falmarri: I see some flaws in your logic. @Falmarri:我发现您的逻辑存在一些缺陷。 Usually I'd tend to follow the same path as you if I'd be developing on another Plattform, like Windows.通常,如果我要在另一个平台(如 Windows)上进行开发,我会倾向于遵循与您相同的路径。 I do my C# applications always against the latest (non-beta) version available, as the .NET Framework is freely available for everyone (take out the new releases not being available for Win2k, which is almost 10 years old now).我的 C# 应用程序总是针对可用的最新(非测试版)版本,因为每个人都可以免费使用 .NET Framework(去掉 Win2k 不可用的新版本,现在已经快 10 年了)。

With Android this attempt don't work.对于 Android,这种尝试不起作用。 A majority of the devices which run 1.5 and 1.6 do it because there is no update for this device, as the manufacturer stopped developing new versions for this phone (either to motivate users to get a new upgraded one) or because it's to time intensive to make backports to this "old" devices.大多数运行 1.5 和 1.6 的设备之所以这样做是因为此设备没有更新,因为制造商已停止为该手机开发新版本(要么是为了激励用户获得新的升级版),要么是因为时间密集向这个“旧”设备进行反向移植。

So this uses don't have the "free choice" of upgrading their phones.所以这个用户没有升级手机的“自由选择”。 Technically it's possible of course with rooted/custom ROMs, however most users do not have the technical knowledge to root/flash their devices with custom ROMs or don't want to lose their warranty.从技术上讲,当然可以使用 root/自定义 ROM,但是大多数用户没有技术知识来使用自定义 ROM 来 root/刷新他们的设备,或者不想失去他们的保修。

So if you want to offer your App to as much people as possible, you have to develop it in mind with a much older OS version.因此,如果您想向尽可能多的人提供您的应用程序,您必须考虑使用更旧的操作系统版本来开发它。 In Android case, against 1.5.在 Android 的情况下,反对 1.5。

And this is basically what I do.这基本上就是我所做的。 I've done my Apps with 1.5 in mind.我已经在考虑 1.5 时完成了我的应用程序。

If you are developing using Android Studio: 1. Go to Tools --> Android --> AVD Manager 2. Click the Create Virtual Device... button of the AVD Manager dialog.如果您使用 Android Studio 进行开发: 1. 转到工具 --> Android --> AVD 管理器 2. 单击 AVD 管理器对话框的创建虚拟设备...按钮。 3. Select a Device on the "Select Hardware" wizard page of the dialog and click Next. 3. 在对话框的“选择硬件”向导页面上选择一个设备,然后单击下一步。 4. In the bottom right of the "System Image" wizard page you will see the following: 4. 在“系统映像”向导页面的右下角,您将看到以下内容:

API 级别分布图链接

If you click the "API level distribution chart" link, it will provide you a summary of cumulative distribution by API level.如果您单击“API 级别分布图表”链接,它将为您提供按 API 级别的累积分布摘要。 I assume the information is kept up-to-date with each release.我假设每个版本的信息都是最新的。 From there you can click on an API level to get specific information about that API level.从那里您可以单击 API 级别以获取有关该 API 级别的特定信息。 Based on the information presented there, you need to use API level 18 or lower in order for about 75% of the current Android Market to be able to use you application.根据那里提供的信息,您需要使用 API 级别 18 或更低级别,以便当前约 75% 的 Android Market 能够使用您的应用程序。

API 级别分布图

Perhaps this is the type of information you are looking for.也许这就是您正在寻找的信息类型。 Hope it helps!希望有帮助!

This is a direct quote from the Android Docs :这是Android Docs的直接引用:

Generally, it's a good practice to support about 90% of the active devices, while targeting your app to the latest version.通常,支持大约 90% 的活动设备是一个很好的做法,同时将您的应用程序定位到最新版本。

In a practical sense, this is impossible unless you had an unlimited budget.实际上,除非您有无限的预算,否则这是不可能的。

Even Android themselves are only releasing security updates from version 8 onward.甚至 Android 本身也只发布版本 8 以后的安全更新。

As of right now, I recommend supporting Android 7 onward.就目前而言,我建议支持 Android 7 及更高版本。 This should cover 57.9% of market share.这应该覆盖 57.9% 的市场份额。

If you scroll to the bottom of this page, there is atable that shows Android support information .如果您滚动到此页面底部,则会有一个表格显示 Android 支持信息

It will be updated monthly as the figures I quote above will change with time.它将每月更新,因为我上面引用的数字会随着时间而变化。

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

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