How to correctly include the support library in no

2019-01-26 12:26发布

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?

2条回答
成全新的幸福
2楼-- · 2019-01-26 13:18

Assuming that you are not using GridLayout:

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

Step #2: There is no step #2.

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 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.

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

查看更多
Root(大扎)
3楼-- · 2019-01-26 13:29

Similar to this automation article http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html

Make sure to generate a valid build.xml file for ant/android building android update project --path /path/to/project

then just ant clean debug

You can also checkout the official doc http://developer.android.com/tools/building/building-cmdline.html

查看更多
登录 后发表回答