Skip to content

Android#

The 'Android' Target#

Monkey2 uses the android NDK (native development kit) to build android apps.

Setting up for Android development#

  1. Install Android Studio and make sure it works, ie: you can build and run one of the simple template projects on a device or emulator.
    Android Studio is available here: Android Studio.

  2. Install the 'NDK' (native development kit) using Android Studio via 'SDK Manager->SDK Tools'.

  3. Install the Android 7.0 (Nougat) SDK Platform (API Level 24) using Android Studio via 'SDK Manager'.

  4. Edit your monkey2 bin/env_windows.txt file and change the ndk-bundle 'PATH' setting so it points to the NDK. Or, you can just add the ndk-bundle directory to your system PATH.
    Please note: Use the file bin/env_macos.txt on macOS and bin/env_linux.txt on Linux.

  5. Fire up Ted2go and select 'Build -> Update/Rebuild Modules -> Android'.
    Alternatively you can (re-)build the android modules on the command-line:
    mx2cc makemods -clean -target=android -config=debug
    mx2cc makemods -clean -target=android -config=release

Building an Android app#

  1. Build your app in Ted2go using 'Build -> Build Only' with 'Build Target -> Android' selected.

  2. Open the generated Android Studio project (at myapp.products/Android) in Android Studio.

Attention

I recommend disabling the following Android Studio setting for Monkey2 development:
File -> Settings -> Build, Execution, Deployment -> Instant Run -> Enable Instant Run
With this enabled, Android Studio doesn't seem to notice when external project files change.