Menu

SDK_Build_Environment_for_Android_Platform

There is a newer version of this page. You can find it here.

SDK Build Environment for Android Platform

This page discusses how to build the Magic Lantern SDK for Android platforms using Android Studio on an Apple Macintosh or Ubuntu 14.04 LTS host development platform.

Note: This technique is currently under development and extremely volatile.

Dependencies

This section identifies dependencies for building the Magic Lantern SDK.

  1. Google's Android Studio, version 2.1.2 (see [Android Studio Installation] for more details).
  2. Oracle Java Development Kit (JDK), version 1.8.0_91 Required by Android Studio (download from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).
  3. Python, version 2.7.6

Assumptions

These instructions assume the following:

  • The dependencies above are installed in their default locations.
  • You already know how to use the Android Studio IDE.
  • You already know how to administer an Apple Macintosh or Ubuntu Linux machine.

Download Source

The source for the Android Studio projects are currently located on Github under the Magic Lantern Studio organization (https://github.com/magic-lantern-android-studio).

Create a Project Directory

In a console window, create a project directory:

$ mkdir ~/MagicLantern

Note: "~" is your home directory (e.g. /home/msm).

Retrieve Source Using Git

In a console window, clone the git repositories from Github:

$ cd ~/MagicLantern
$ git clone https://github.com/magic-lantern-android-studio/core-math.git
$ git clone https://github.com/magic-lantern-android-studio/core-runtime.git
$ git clone https://github.com/magic-lantern-android-studio/parts-base.git
$ git clone https://github.com/magic-lantern-android-studio/parts-actors.git
$ git clone https://github.com/magic-lantern-android-studio/parts-roles.git
$ git clone https://github.com/magic-lantern-android-studio/parts-sets.git
$ git clone https://github.com/magic-lantern-android-studio/parts-stages.git
$ git clone https://github.com/magic-lantern-android-studio/parts-mrefs.git
$ git clone https://github.com/magic-lantern-android-studio/parts-props.git
$ git clone https://github.com/magic-lantern-android-studio/titles-imagetest.git
$ git clone https://github.com/magic-lantern-android-studio/mle-tools.git

You should now have eleven Android Studio projects located in

Project Description
~/MagicLantern/core-math Magic Lantern Math utility library
~/MagicLantern/core-runtime Magic Lantern Runtime Engine library
~/MagicLantern/parts-base Magic Lantern Parts support library
~/MagicLantern/parts-actors Magic Lantern Actors library
~/MagicLantern/parts-roles Magic Lantern Roles library
~/MagicLantern/parts-sets Magic Lantern Sets library
~/MagicLantern/parts-stages Magic Lantern Stages library
~/MagicLantern/parts-mrefs Magic Lantern Media Reference library
~/MagicLantern/parts-props Magic Lantern Properties library
~/MagicLantern/titles-imagetest Magic Lantern Image Test application
~/MagicLantern/mle-tools Magic Lantern Tools

Retrieve source using repo

Alternatively, you can use the "repo" tool from Google (see [repo Installation Instructions]) to download the source.

$ cd ~/MagicLantern
$ repo init -u https://github.com/magic-lantern-android-studio/mle-tools.git
$ repo sync

Build Core Math utility library

To build the Magic Lantern Core Math library, mlmath.jar, open the existing Android Studio project found at "~/MagicLantern/core-math". In the Android Studio launch screen, select "Open an existing Android Studio project". In the "Open File or Project" dialog panel, navigate to "~/MagicLantern/core-math" directory and select "OK". This will bring up the main Android Studio IDE, showing the "core-math" project in the "Project" window (you may need to expand this Window to see the project. By default, the project should successfully build.

Note: You may need to install the build tools and sync the project before the build is successful. The "Messages Gradle Sync" window will display an Error if this is the case.

Export the jar by running the "exportJar" Gradle task. To do this, open the "Gradle" window and navigate to the "core-math->core-math->Tasks->other" folder. There you should see an "exportJar" task; run the task by selecting it (double-click). The mlmath.jar library will be created in the project's "app/release" directory.

Copy the mlmath.jar library to the other Magic Lantern projects that are dependent upon it. This can be done by running the "~/MagicLantern/mle-tools/scripts/stagelibs.py" python script.

Build Core Runtime Engine library

Build Application Framework Base library

Build Application Framework Media Reference library

Build Application Framework Roles library

Build Application Framework Props library

Build Application Framework Stages library

Build Application Framework Sets library

Build Application Framework Actors library

Image Test Application


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.