Skip to content
akash edited this page Nov 6, 2012 · 12 revisions

The project was developed with IntelliJ IDEA 11 Community edition, though Eclipse will work just as well.

Testing was done using emulators with Android OS v2.2 and above. We want to keep trying to use Android v2.2 and above as the main testing devices and target OS version since these will very likely be what will be used in the field.

Development Environment Setup

  • RapidFTR Android is a maven project. It consists of two modules by names RapidFTR-Android and RapidFTR-AndroidTests.
  • RapidFTR-Android maven module have the source code along with the the unit test code. Unit tests are written with the help of Robolectric.
  • RapidFTR-AndroidTests have the integration tests written in Robotium

Android SDK download

  • Download the android sdk from the android developers website and unzip the same.
  • If you are on Mac, recommended way of installation is to use homebrew Ex: brew install android
  • We would be supporting from the API Version 8(Android 2.2). Download the appropriate libraries for android 2.2 version.
  • Create an AVD with the size 240320. The lease resolution we would be using is 240320, so, testing for that resolution will help.

IDE setup

  • If you are using Intellij Idea then the maven projects could be imported directly.
  • to run the tests in IntelliJ edit the default JUnit run configuration and amend the working directory to point to ...../RapidFTR---Android/RapidFTR-Android (by default it will just point to ...../RapidFTR---Android )
  • If you get any error related to maven, then click on Preferences => Maven then specify the Maven home directory: to the path of the maven home (In Mac OSX its /usr/share/maven.)
  • If you get android-sdk path related error add this to pom.xml with in tag "<android.sdk.path>'path to the android home folder in you machine'</android.sdk.path>".
  • Intellij comes with default Android support, so once the project is loaded it asks for configuring the android framework. Go ahead and configure the framework.
  • If you are using Eclipse, download the Eclipse ADT plugin for android and also m2eclipse plugin
  • Import the project as existing maven project. If eclipse is not able to run the app because of the heap issues then increase the heap memory in eclipse.ini. Here are some of the configurations recommended -XX:MaxPermSize=1536m -Xms1536m -Xmx1536m

Run the tests

  • You can run all the tests from the android parent directory RapidFTR---Android by using the command mvn clean install. This will also generate the .apk files which could be installed on the mobile phones for testing.
  • To run unit tests alone, navigate to RapidFTR-Android folder and then run mvn clean install. Same is the case with integration-tests, move to RapidFTR-AndroidTests and run mvn clean install.
  • To run individual unit test from IntelliJ, go to the unit test and run it a junit test. You might get some error, If you get an error, edit the configuration and select the working folder as RapidFTR-Android sub folder instead of RapidFTR---Android main folder.

Why Maven

  • Though ANT will work for us, as we are using good amount of external jar files, we need some kind of dependency management tool.
  • Any dependency management tool helps project to be moved easily from one machine to the another and aids in easy setup of the IDE.(ex: maven handles the dependency and the build stuff) - IDE neutral.
  • Dependency management will be provided by many tools including ivy, gradle etc,. But android-maven-plugin seems to be widely used and have very good active community(have many releases in the recent past).
  • Android-maven-plugin in specific gives most of the phases of android development for free - apk, apklib, zip, align, unpack, deploy, deploy-dependencies, redeploy, undeploy, emulator-stop/start run, push and pull logs.
  • Maven by default provides a standard release workflow - multiple profiles and patching up an existing library or stripping of some unnecessary classes out of jar(maven-shade-plugin)

Clone this wiki locally