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?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
Assuming that you are not using
GridLayout
:Step #1: Copy
android-support-v4.jar
orandroid-support-v13.jar
from your SDK into thelibs/
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 likeViewPager
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.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