Knowledge Seeking

Android Applications with Maven – How Should We Start? December 10, 2010

Filed under: Java — nicozan @ 3:15 pm

Now days more and more cellphones are using Android as its OS. So if you are interested in developing simple or complex apps for your device, you just need a couple of concepts and tools to get started.
We`ll be doing this first approach using:
-Maven (2.x or greater).
-JDK 1.6
-Android SDK 2.3.x
-ADT plugin for Eclipse
-On Windows

Before we proceed with the explanation, I need to warn you about how to install the Android SDK 2.3.x. In previous versions you just needed to add to your PATH (Environment Variable), %ANDROID_HOME%\tools (ANDROID_HOME = ..\android-sdk-windows).But in the 2.3.x we need to set too %ANDROID_HOME%\platform-tools.

Another useful tip if you are using Eclipse it`s to keep UPDATED the ADT (Android Development Tools) Plugin and the DDMS.

So now let`s describe the steps to create, compile and deploy our Android App:

Note: In this Link you can find the example I am describing.

1- In the Eclipse IDE go to File -> New -> Android Project.
2- Once you have finished the creation step, you have to create the pom.xml in the PocAndroidMaven/pom.xml location. Inside our pom.xml we`ll have:

<?xml version="1.0" encoding="UTF-8"?>
  <project xmlns=""

  			<name>JBoss Public Maven Repository Group</name> 




3-We have to pay special attention to the maven-android-plugin artifact. The main part to understand is that when we execute, in the CLI(Command Line Interface), mvn clean install it will create our APK package, install it in our Local Maven Repository %USER_HOME%\.m2\repository and deploy our APK in the AVD (Android Virtual Device). PLEASE REMEBER TO HAVE THE AVD RUNNING WHEN YOU DO THE BUILD.

This was a brief explanation to build an Android Maven App, thats why I am leaving you these links:

Android Developers
SonaType Maven Android Plugin Documentation


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s