Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Project setup

Tom Clement Oketch edited this page Jun 21, 2014 · 64 revisions

We are currently targeting Android v2.3.6 because those are the devices that are currently used. However, this is going to change as we shall be supporting Android v4.0.x and above, since its getting very difficult to find 2.3.x devices in the first place.

We're slowly porting Activites and Beans to use the excellent Android Annotations library. So you'll find classes with an underscore, like RapidFtrApplication_, which are generated by AndroidAnnotations during compile time.

Setup Pre-requisites

  • JDK 1.7
  • Maven 3.2 or above
  • Running mvn -version should say clearly that its using JDK 1.7, and not the system JDK 1.6. If this is the case, then either fix JAVA_HOME, or use JEnv

Setup Android SDK

  • Download the android sdk from the android developers website and unzip the same. If you are on Mac, it is recommended to use homebrew to install Ex: 'brew install android'
  • Enter android sdk in your terminal to open the SDK manager, and install the following items:
    • Platform tools
    • Build tools
    • Extras > Android support library
    • Extras > Android maven repository
    • Android 2.3 API
    • Android 2.3 System Image for the emulator

Setup Android Emulator

  • Enter android avd to open the AVD (Emulator) manager
    • Create an AVD (from within the SDK Manager) with the following settings:
AVD Name: rapidftr
Device: 2.7" QVGA (240x320 ldpi)
Target: Android 2.3.3 - API Level 10
SD Card: 200 MB
(you can leave all other options as is)

The least resolution we would be using is 240*320, so, testing for that resolution will help.

  • Launch the created AVD

As a faster alternative to using the android AVD, you can use Genymotion. For instructions on how to setup and use Genymotion visit (https://cloud.genymotion.com/page/doc/)

Build from the Command Line

  • Run mvn clean package from the RapidFTR-Android folder to test whether everything is working properly. This will build the APK inside the target folder
  • Run mvn android:deploy android:run to deploy and run the generated APK to the emulator

IDE setup

IntelliJ Idea 13 Community Edition

  • Simple import: File > Open Project and select RapidFTR-Android/pom.xml file, and the Maven project will be automatically imported. For more information on how to do this (http://www.jetbrains.com/idea/webhelp/importing-project-from-maven-model.html)
  • 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.
  • Next Steps:
    • Set Project SDK as JDK 1.7 in File > Module settings
    • Install Lombok Plugin from IntelliJ Preferences > Plugins
    • Add target/generated-sources/annotations as a Source Folder in File > Project Structure. This is required for AndroidAnnotations generated classes to be correctly parsed by the IDE
  • Troubleshooting Errors:
    • Set ANDROID_HOME in Preferences > Path Variables
    • Set Maven home folder in Preferences > Maven
Clone this wiki locally