为什么每当我创建新项目时 Eclipse 都会自动添加 appcompat v7 库支持? [英] Why does Eclipse automatically add appcompat v7 library support whenever I create a new project?

查看:37
本文介绍了为什么每当我创建新项目时 Eclipse 都会自动添加 appcompat v7 库支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么每次创建新项目时 Eclipse 都会自动添加 appcompat v7 库支持?

Why does Eclipse automatically add appcompat v7 library support whenever I create a new project?

我正在创建一个简单的项目,它的 MainActivity 应该扩展 Activity,但它没有.Eclipse 自动添加操作栏支持.

I am creating a simple project whose MainActivity should extend Activity, but it does not. Eclipse automatically adds action bar support.

如何在没有 appcompat 库的情况下创建一个简单的项目?仅供参考,我已经下载了最新版本的 ADT,最近更新了所有内容.我使用的是 Window 7 x64.

How do I create a simple project without the appcompat library? FYI, I have downloaded the latest version of ADT with everything updated recently. I am using Window 7 x64.

推荐答案

如 Android 的 支持库概述,默认情况下包含支持库被认为是一种很好的做法,因为设备的多样性以及不同版本的 Android(以及所提供的 API)之间存在的碎片化.

As stated in Android's Support Library Overview, it is considered good practice to include the support library by default because of the large diversity of devices and the fragmentation that exists between the different versions of Android (and thus, of the provided APIs).

这就是为什么 Android 代码模板工具通过 Eclipse 包含在 Eclipse 中的原因Android 开发工具 (ADT) 默认集成它们.

This is the reason why Android code templates tools included in Eclipse through the Android Development Tools (ADT) integrate them by default.

我注意到您的示例中的目标是 API 15,但是您的包所需的最小 SDK 是 API 10,兼容性库可以为此提供大量向后兼容的 API.一个例子是使用 Fragment API 出现在运行旧版本系统的设备上的 API 11 (Android 3.0 Honeycomb).

I noted that you target API 15 in your sample, but the miminum required SDK for your package is API 10, for which the compatibility libraries can provide a tremendous amount of backward compatible APIs. An example would be the ability of using the Fragment API which appeard on API 11 (Android 3.0 Honeycomb) on a device that runs an older version of this system.

还需要注意的是,您可以在默认情况下取消自动包含支持库.

It is also to be noted that you can deactivate automatic inclusion of the Support Library by default.

这篇关于为什么每当我创建新项目时 Eclipse 都会自动添加 appcompat v7 库支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆