I would like to setup the Android v7 appcompat library in order to use the ActionBar. At
http://developer.android.com/tools/support-library/setup.html#
there is a tutorial how to add libraries with resources using Eclipse. Since I am not using Eclipse I would like to add the library and the accompanying resources by manually editing and copying the required files. Can anyone perhaps provide me with this necessary steps?
To use a Java library (JAR file) inside your Android project, you can simple copy the JAR file into the folder called libs in your application. *. jar files in this folder are included into the compile classpath via the default build.
The Application class in Android is the base class within an Android app that contains all other components such as activities and services. The Application class, or any subclass of the Application class, is instantiated before any other class when the process for your application/package is created.
Android App Development for Beginners The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level.
OK, finally I found it out. The keywords are library project and command line.
In order to add the appcompat v7 as library project to an own project using the command line the following steps worked for me:
Create a copy of the folder android-sdk/extras/android/support/v7/appcompat
into the own project space. You may call it anything, we will keep the appcompat
name.
cd my_project
cp -r android-sdk/extras/android/support/v7/appcompat appcompat
Generate a build.xml file for the library project: execute
android update lib-project --path appcompat
reference the library project and create the dependency in the project's project.properties
file
android.library.reference.1=appcompat
build the main project:
ant clean debug
This will automatically build the support library, too. You generally need a clean build after adding a library or changing the target versions, so the build picks up all the changes.
These are useful resources:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With