Classy Data

Complete Set Up for Android Development

Android Prerequisites

Android development requires installing the Android SDK and creating an ANDROID_HOME environment setting to point to it. New Android versions come out regularly, so the latest version is unlikely to be compatible with the Classy Data project. The "Android SDK Packages" panel opposite indicates the correct SDK Platform version to be selected from the SDK Manager. Maven creates a file URI based on the ANDROID_HOME setting to access the Android SDK, so it must be accessible using this approach (eg. file permissions allow read access to logged in user).

Google Maven Repository

Android support libraries are now available online. Add the following repository to your Maven settings.xml configuration file:

  <profiles>
...
    <profile>
      <id>google</id>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>google</id>
          <name>android</name>
          <url>https://maven.google.com</url>
        </repository>
      </repositories>
    </profile>
...
  </profiles>
  <activeProfiles>
...
    <activeProfile>google</activeProfile>
...
  </activeProfiles>

Classy Data Initialization

This is a once-only step that depends on successful completion of the initial Classy Data installation. From a console in the Classy Data home location, run:

mvn initialize -P android-build,install -pl :support-v4-lib

This will install the Android jar for API24 from the Android SDK1 to your local repository, as this artifact is not available online2. Upon completion, the message "BUILD SUCCESS" should be displayed.

Build and deploy Classy Data artifacts

Again in the Classy Data home location, run:

mvn clean install -P android-build

Upon completion, the message "BUILD SUCCESS" should be displayed. If the build failed, then you will need to scroll back and investigate what error messages appeared during the build.

Android SDK Packages

The Android SDK foundation package is Android SDK Tools. This has the SDK Manager which installs all the other packages. For instructions see Android Studio or command line SDK Manager. Classy Data targets Android 7.1 Nougat (API 25). Targeting another SDK version will require some minor changes to the properties in the project parent pom.xml located in the home directory.

android_packages
For more details on packages, go to Changing SDK Package/Version Configuration.

Android Studio

Android Studio is the official IDE for Android application development, based on IntelliJ IDEA. A set of sample applications, packaged as an Android Studio project and employing an online release of Classy Data, is available from Github. Go to Classy Android for more details. Also check out Notes on Android Studio.

Maven/Eclipse

An alternative sample applications project combines Maven with Eclipse Andmore to meet requirements such as:

  • Cannot migrate at the moment to Android Studio
  • Run a Continuous Integration (CI) server such as Jenkins
  • Want to automate application releases with Maven

Go to Classy Apps for instructions on Maven + Eclipse Andmore.

Notes
  1. Google does not install Android platform jars in a public respository, so one must be deployed from the SDK. The required path is constructed using ANDROID_HOME environment variable and the platform number defined as property "android.platform.version" in the Classy Data home pom.xml file.
  2. Robolectric dependencies are also installed locally as an initializaton goal as otherwise this happens the first time a test using Robolectric is run.