Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to correctly include the support library in non-Eclipse Android application

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?

like image 953
Phitherek_ Avatar asked Jul 15 '13 16:07

Phitherek_


1 Answers

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.

like image 56
CommonsWare Avatar answered Oct 20 '22 10:10

CommonsWare