Quantcast
Channel: vogella blog » ADT
Viewing all articles
Browse latest Browse all 7

Android library projects – Renting some code

$
0
0

Android does not require that all source code used by one application is directly included into this application.,

Android library projects allow to store source code which is used by several other Android projects. Library projects cannot be compiled to .apk files directly. If a project which uses the library project is compiled the ADT compiles the library and adds the compiled source to the .apk file of the compiled application. Therefore a library project can be considered to be a compile-time artefact.

To create a library project simply create a standard Android project. Select the generated project and right-click on it and select properties. On the Android tab select the flag “Is Library”.

On the same screen a project which want to use the library must add its dependency to the library project.

The library project must declare all its components, e.g. Activities, Service, etc. via the AndroidManifest.xml. The application which uses the library must also declare all the used components via the AndroidManifest.xml file.

For more details, potential resource conflicts and their resolution please see Android library projects.

I hope this helps.


Viewing all articles
Browse latest Browse all 7

Trending Articles