android - 在 Android 应用程序中选择 "Compile with"API 选项的良好实践

标签 android

创建 Android 应用程序时,我必须选择“编译方式”API 选项。该选项的帮助说明我通常使用最新版本,或者第一个支持我想使用的所有 API 的版本。

我有以下问题:

*据我所知,最新的 API“包含或支持”(不确定是否因为使用了 Android 支持库)以前的 API。这使得不必下载以前的 API 来编译具有一些以前的 API 要求的 android 项目?
例如,假设我要创建一个“目标 SDK”为 GingerBread 的应用程序,在这种情况下使用最新的 API(Jelly Beans)作为“编译 API”是否是一个好习惯?我想问题可能出在使用仅适用于 JellyBeans 的 API,但 Lint 可以帮助解决这个问题。

*如果上面的问题是真的,我只需要下载以前的API就可以运行那些版本的模拟器?

谢谢!

最佳答案

as far i as understand, the newest APIs "contains or support" (not sure if its because of the use of Android Support Library) the previous APIs.

一般来说,这是正确的。

This makes unnecessary to download a previous API to compile an android project which has some previous API requirements?

一般来说,这也是正确的。

For example, lets say im gonna create an application whose "Target SDK" is GingerBread, is it a good practice to work with the latest API (Jelly Beans) as the "compile API" in this scenario?

这样做没有错,只要您将 android:minSdkVersion 设置为您想要的。

I suppose that the problem could be to use an API that is only available for JellyBeans but Lint can help to solve that.

正确。

If the above question is true, I only need to download previous APIs only for running the emulator with those versions?

正确。具体来说,您正在寻找 SDK 管理器中的“...系统镜像”条目,至少是 ARM 和 x86 条目。

关于android - 在 Android 应用程序中选择 "Compile with"API 选项的良好实践,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14940395/

相关文章:

android - 如何以编程方式获取华为应用市场上应用程序的版本?

android - 使用 DownloadManager 将数据从 Activity 传递到 BroadcastReceiver

android - ActionBarActivity 和 FragmentActivity 中的 setContentView

android - Xamarin Android "ScrollView"奇怪的行为

android - 禁用 ListItem 的选择性

android - 从一个 ListView Activity 移动到另一个 ListView Activity

android - 以编程方式清除短信通知

android - 带有相机预览的 TextureView

android - (this::methodName) 如何在此代码中工作?

java - 如何从两个 Activity 之间的多个回显返回数据?