-1

First steps to use the android-maven-plugin?

Kate Gregory
  • 18,808
  • 8
  • 56
  • 85
cibercitizen1
  • 20,944
  • 16
  • 72
  • 95

1 Answers1

2

1 Set android home

export ANDROID_HOME=/your/android-SDK/path

2 Run

mvn archetype:generate -DarchetypeArtifactId=android-with-test 
-DarchetypeGroupId=de.akquinet.android.archetypes -DarchetypeVersion=1.0.9 
-DgroupId=org.me -DartifactId=myAndroidApp -Dplatform=8

Here To check the archetypeVersion or look for other ones.

3

Edit myAndroidApp/pom.xml (parent level pom.xml) to set (it is initially void)

<platform.version> 2.2.1 </platform.version>

in the properties section. Please make sure the correspondence between platform 8 and platform.version 2.2.1 You can learn in your android sdk manager app that API 8 <-> 2.2, but must visit here to see that the final number is 2.2.1. (Note: for API 10 <-> 2.3.3).

4

You can start right now to play with it. In the parent directory:

mvn clean install

and to run it (in myAndroidApp/myAndroidApp directory)

cd myAndroidApp
mvn android:run

Be sure you started a phone emulator or attached a real phone (in debug mode) to your computer.

Hope this saves you a whole weekend! (Too late for me ;-) )

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
cibercitizen1
  • 20,944
  • 16
  • 72
  • 95
  • 1
    Just keep in mind that the archetype is out of date at this stage. Might be better to replicated and adopt one of the example projects: http://simpligility.github.io/android-maven-plugin/examples.html – Manfred Moser Jul 20 '15 at 22:28