Android - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

This article is about the android operating system and developing and publishing games for it.

Getting it to work

This process has only been tested for the Ubuntu Operating System and revision r870, and I have not been able to get it to fully compile yet. Some reports indicate that this process may have broken in more recent revisions (r973).

First, you should have a working copy of ENIGMA already (and, by extension, LateralGM). Ensure that it is up-to-date, or at least matches the revisions that this article has been tested/confirmed for. Also, ensure that you have all other relevant prerequisites installed and up-to-date.

You will also need a copy of the Android SDK and the Android NDK.

  1. Unzip the SDK to a sensible location. Here we will assume that it is /home/username/android/android-sdk-linux_x86
  2. Unzip the NDK inside of the resulting SDK directory. Here we will assume that it is /home/username/android/android-sdk-linux_x86/android-ndk-r4-crystax

# In trunk/ENIGMAsystem/SHELL/Makefiles/, copy MacOSX/Android and MacOSX/AndroidSym into Linux/ and change their contents so that they reflect the location of your ndk. For instance:

Replace:
cd Platforms/Android/EnigmaAndroidGame/jni && /Users/alasdairmorrison/Documents/AndroidSDK/crystax/ndk-build
with
cd Platforms/Android/EnigmaAndroidGame/jni && /home/username/android/android-sdk-linux_x86/android-ndk-r4-crystax/ndk-build

Once installation is done, it's time to load up your game and invoke the compiler.

  1. Start up ENIMGA/LateralGM.
  2. Load/Create your game, and ensure that it has aspects that seem compatible with an Android.
    • For a first-time game, I'd recommend something very simple, such as a single room with a color background, just to make sure it works.
  3. Change the compiler to the Android compiler.
    1. Open Enigma Settings (either by double-clicking the tree node or through the Enigma > Settings menu).
    2. Open the API tab, and locate the "Compiler" dropdown.
    3. Change the selected compiler to Android compile.
    4. Confirm your selection by clicking the Green Checkbox in the top-left corner.
  4. Compile/Run by clicking Engima -> Run. It should start compiling things with a lot of lines starting with "Compile++"

Meta: At this point, my terminal looks like this and my Progress Console looks like this

Game Requirements

  • You should limit input methods to mouse events, since android input is entirely touch-based. Other input methods like the keyboard would require android to have a virtual on-screen keyboard displayed for the user to interact with. (More information is needed here for mouse and keyboard support and specifics)
  • Android does support 3d, however it uses its own GLES graphics system. This system is mostly similar to GL, with some performance- and under-the-hood- differences.
  • Android offers additional support to multi-touch. At the current time, no functions are immediately provided to handle this capability, but it would be fairly simple to add.
  • View size should be tailored to the device you are targeting. If your view is the full room, the room should be sized accordingly as well. Other than that, the size is up to you. (More info is needed here for device size specifics)