Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

Posts Tagged "Maven"

Build your Android project in one step with Maven

Cris Kim

I will assume the following has been installed and configured.

Android SDK (r07 or later)
Maven 3 (version 3.0.3)

Set environment variable ANDROID_HOME to point to the root directory of the Android SDK.
Add ANDROID_HOME/tools to your PATH environment variable.

An Android project to build

Building an Android project consists of 3 steps. The code is compiled to create an executable apk file, then the apk is signed and finally zipaligned to optimize disk space usage on the mobile device.
Executing these steps manually is prone to human error and can lead to bad builds. This can happen due to forgetting to sign the package, missing dependencies, etc. It is also time consuming especially if you have fast iteration cycles and/or multiple build configurations for different version of the Android OS. Using Maven and¬†android-maven-plugin we can create a one step process to manage dependencies, build, sign and…