Motive Animation System
An open source project by FPL.
 All Classes Functions Variables Typedefs Friends Pages
Building for Android

Prerequisites

Set up your build environment for Android builds by following these steps.

  1. Install Java 1.7, required to use Android tools.
    • Windows / OSX: Download the Java 1.7 installer and run it to install.
    • Linux: on systems that support apt-get...
      sudo apt-get install openjdk-7-jdk
  2. Install the Android SDK, required to build Android applications.
    Android Studio is the easiest way to install and configure the latest Android SDK. Or you can install the stand-alone SDK tools.
  3. Install the Android NDK, required to develop Android native (C/C++) applications.
    • Download and unpack the latest version of the Android NDK to a directory on your machine.
      • Tested with android-ndk-r10e.
  4. Add the Android SDK's sdk/tools directory and the Android NDK directory to the PATH variable.
    • Windows: Start -> Control Panel -> System and Security -> System -> Advanced system settings -> Environment Variables, then select PATH and press Edit. Add paths similar to the following, adjusted for your install locations: c:\Users\me\AppData\Local\Android\sdk\tools;c:\Users\me\android-ndk
    • Linux: if the Android SDK is installed in /home/androiddev/adt and the Android NDK is installed in /home/androiddev/ndk the following line should be added to ~/.bashrc.
      export PATH="$PATH:/home/androiddev/adt/sdk/tools:/home/androiddev/ndk"
    • OS X: if the Android SDK is installed in ~/Library/Android/ and the Android NDK is installed in ~/bin/android_ndk-r10e the following line should be added to ~/.bash_profile.
      export PATH=$PATH:~/bin/android_ndk-r10d:~/Library/Android/sdk/tools
  5. On Linux, ensure Java 1.7 is selected, in the event multiple Java versions are installed on the system.
    • on Ubunutu, run update-java-alternatives to select the correct Java version.
  6. On Windows, set the JAVA_HOME variable to the Java install location

Additionally, if you'd like to use the handy tools in fplutil,

  • Apache Ant, required to build Android applications with fplutil.
    • Windows / OS X: Download the latest version of Apache Ant and unpack it to a directory.
    • Linux: on systems that support apt-get...
      sudo apt-get install ant
    • Add the Apache Ant install directory to the PATH variable.
  • Python 2.7, required to use fplutil tools.
    • Windows / OS X: Download the latest package from the Python 2.7 page and run the installer.
    • Linux: on a systems that support apt-get...
      sudo apt-get install python

Code Generation

Using ndk-build:

cd motive
ndk-build

Using fplutil:

cd motive
./dependencies/fplutil/bin/build_all_android -E dependencies -T debug -i -r

Note: The -T debug, -i, and -r flags are optional. The -T flag sets up debug signing of the app, which allows it to be installed for testing purposes. The -i flag declares that the script should install the app to a connected device. The -r flag declares that the app should also be run, after it is installed.

The Benchmarker App

The Benchmarker app is in motive/src/benchmarker. It creates and updates 40000 Motivators of various flavors, and measures their various execution times.

To install and run the Benchmarker app on an Android device:

  • Install the Prerequisites.
  • Attach an Android device for USB debugging.
  • Open a command line window and go to motive/benchmarker.
  • Execute motive/dependencies/fplutil/bin/build_all_android with the -S (app signing), -i (install) and -r (run) options.
cd motive/src/benchmarker
../../dependencies/fplutil/bin/build_all_android -E dependencies -S -i -r