$ export JAVA_HOME=/opt/jdk-1.8.0
$ export PATH=$JAVA_HOME/bin:$PATH
$ java -version
java version "1.8.0_281"
...
$ export M2_HOME=/opt/maven-3.1
$ export PATH=$M2_HOME/bin:$PATH
$ mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
...
The installation of the Android SDK is described in documentation/android.md.
$ export ANDROID_HOME=~/android-sdk
$ export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH
$ which android
/home/clemens/android-sdk/tools/android
$ android --help
From Maven Android SDK Deployer:
The Maven Android SDK Deployer is a helper maven project that can be used to install the libraries necessary to build Android applications with Maven and the Android Maven Plugin directly from your local Android SDK installation.
$ cd ~
$ git clone https://github.com/mosabua/maven-android-sdk-deployer
$ cd maven-android-sdk-deployer
$ git checkout 4c545b6c20a13d9885506fd4790cc7298096c502
$ mvn install -P 2.3.3
$ android list avd
Available Android Virtual Devices:
$ android create avd --name android-10 --target android-10 --abi armeabi
...
Do you wish to create a custom hardware profile [no] no
...
$ android list avd
Available Android Virtual Devices:
Name: android-10
Path: /home/clemens/.android/avd/android-10.avd
Target: Android 2.3.3 (API level 10)
Tag/ABI: default/armeabi
Skin: WVGA800
$ cd ~
$ git clone git://github.com/vakuum/foul-android.git
$ cd foul-android/foul
$ mvn clean package android:apk -DskipTests
$ ls target/foul.apk
target/foul.apk
$ mvn android:emulator-start
$ adb shell input keyevent 82
$ mvn android:deploy
$ mvn android:redeploy
$ mvn android:undeploy
$ mvn android:emulator-stop
$ cd ~
$ git clone git://github.com/vakuum/foul-android.git
$ cd foul-android
$ mvn clean test --projects foul
...
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.341 sec
...
$ mvn clean install --projects foul
$ ls foul/target/foul.apk
foul/target/foul.apk
$ mvn android:emulator-start --projects foul
$ adb shell input keyevent 82
$ mvn android:deploy --projects foul
$ mvn clean integration-test --projects foul-test
...
[INFO] Tests run: 5, Failures: 0, Errors: 0
...
$ mvn android:undeploy --projects foul
$ mvn android:emulator-stop --projects foul