Skip to content
Joshua Granick edited this page Jan 1, 2014 · 2 revisions

You may use the "android" target when using "lime" commands:

lime test android

You may also use the "-emulator" flag to target the Android emulator, but do not expect great results, as the Android ARM device emulator is very slow.

lime test android -emulator

This past year, support for x86 simulation of Android has become standard. Lime does not currently support x86 Android builds, but this has been considered for the future. With Android devices being inexpensive, most developers have access to hardware they can use, which limits the practical value to Android x86 support, however new devices on the market have begun to use x86 natively (such as Lenovo Android phones) so this will have to be considered.

Due to the nature of the symbiotic relationship of Java and JNI for C++ code execution on Android, Android is the most complex target. As old Android devices have continued to fall out of fashion, we have recently increased the minimum Android target from API 7 (Android 2.1) to API 9 (Android 2.3). This improves support for native C++ file access, adds support for hardware OpenSL ES support for better audio, and means that we can use OpenGL ES 2.0 by default without too much concern. These improvements still lead to a target that is more fussy than most, as OpenSL ES quality varies between devices and OS versions (Android 4.0 had poor support, 4.1 was improved, 4.2 is better) and Android still tends to lead to headaches.

In order to better support Java-based extensions for Lime projects, Lime has also been updated to support Android library projects, which are now better supported in the Android SDK tools. This allows for Android manifest merging, and complex dependencies. The "dependencies" directory includes the default "extension-api" project which helps forms the basis for Lime support on Android. You can reference "../extension-api" as a dependency in your own extensions in order to access these same classes from your code.

In the past, it became for extensions to override GameActivity.java and other template parts of the Lime Android target. DO NOT override these files. You should use the Android extension API as a safe way to hook into the functionality of Lime, without conflicting with improvements and changes that may happen with Lime itself.

We currently use custom Java to handle windowing for Android, and OpenAL for audio (working over OpenSL ES) hooked into the Lime C++ codebase. The code has been used in production for some years, so by-and-large support is of quality, but we welcome improvements or input in continuing to best support the platform.

Clone this wiki locally