如何在非 Eclipse Android 应用程序中正确包含支持库 [英] How to correctly include the support library in non-Eclipse Android application

查看:26
本文介绍了如何在非 Eclipse Android 应用程序中正确包含支持库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑如何让 Android 的支持库在 Eclipse 之外包含和编译.我使用 Linux 作为我的构建环境,我没有使用任何 IDE 来创建应用程序,只使用基本的 Android SDK.我只回答了这个关于 Eclipse 的问题,但是我怎么能只使用 Ant 和 Android SDK 来做到这一点?

I am thinking how to get Android' s support library to include and compile outside Eclipse. I am using Linux as my build environment and I am not using any IDE for creating apps, only the basic Android SDK. I have only come over answers to this question regarding Eclipse, but how can I do it using only Ant and Android SDK?

推荐答案

假设您没有使用 GridLayout:

第 1 步:将 android-support-v4.jarandroid-support-v13.jar 从您的 SDK 复制到 libs/> 项目目录.

Step #1: Copy android-support-v4.jar or android-support-v13.jar from your SDK into the libs/ directory of your project.

第 2 步:没有第 2 步.

Step #2: There is no step #2.

选择 android-support-v13.jar 如果您使用本机片段(而不是 Android 支持包自己的向后移植)并且希望将它们与 ViewPager 之类的东西一起使用这是 Android 支持包的一部分.

Choose android-support-v13.jar if you are using native fragments (versus the Android Support package's own backport) and you want to use them with things like ViewPager that are part of the Android Support package.

GridLayout 使事情变得有点复杂,因为它是一个 Android 库项目.您需要遵循 有关如何在命令行项目,可能使用官方项目的副本.

GridLayout makes things a bit more complicated, in that it is an Android library project. You would need to follow the instructions for how to use an Android library project in a command-line project, probably working off of a copy of the official project.

所有这些内容都可以在安装 SDK 的任何位置的 extras/ 目录中找到.

All of this stuff can be found in the extras/ directory of wherever your SDK is installed.

这篇关于如何在非 Eclipse Android 应用程序中正确包含支持库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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