Difference between revisions of "Compiling ScummVM/Android"

Jump to navigation Jump to search
Update for new toolchain
(Mention required version of Platform-tools)
(Update for new toolchain)
Line 5: Line 5:
= Mandatory tools =
= Mandatory tools =


* [http://developer.android.com/sdk/index.html Android SDK] r09 as of this writing - note that this requires JDK 6, '''NOT''' JDK 7 (which can cause build failures)
* Android SDK Manager from Android Studio or from Command line tools - https://developer.android.com/studio
* [http://developer.android.com/sdk/ndk/index.html Android NDK] r5b as of this writing


Use the SDK Manager to install:
Use the SDK Manager to install:
* Android SDK Tools
* Platform tools
* Android SDK Platform-tools r06 or later
* Build Tools 29.0.3 
* SDK Platform Android 4.0, API 14
* SDK Platform API 29
* NDK 21.0.6113669


Set the <tt>ANDROID_SDK</tt> environment variable to the root directory of the SDK, and <tt>ANDROID_NDK</tt> to the root directory of the NDK.
Set the <tt>ANDROID_SDK_ROOT</tt> environment variable to the root directory of the SDK, and <tt>ANDROID_NDK_ROOT</tt> to the root directory of the NDK - default installation: <tt>${ANDROID_SDK_ROOT}/ndk/21.0.6113669</tt>


= Optional libraries =
= Optional libraries =
Line 28: Line 28:
== Build the libraries yourself ==
== Build the libraries yourself ==


Here's a a simple script to set up a shell for crosscompiling:
Warning: this sections is not yet updated for new Android toolchain
 
Here's a a simple script to set up a shell for crosscompiling for <tt>arm-v7a</tt>:


  #!/bin/sh
  #!/bin/sh
Line 105: Line 107:


The Android port can be compiled with the <tt>configure</tt> script.
The Android port can be compiled with the <tt>configure</tt> script.
Set the <tt>ANDROID_SDK</tt> environment variable to the root directory of the SDK, and <tt>ANDROID_NDK</tt> to the root directory of the NDK. Add the directory of the toolchain binaries from the NDK to your <tt>PATH</tt>. This directory differs, on Linux its <tt>$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin</tt>.


The most basic way to accomplish this is to run:
The most basic way to accomplish this is to run:


  ./configure --host=android --enable-plugins --default-dynamic
  ./configure --host=android-arm-v7a
  make
  make


Line 118: Line 118:
If you followed the [[#Optional libraries|above description]] and have those libraries in <tt>/opt/android/3rd-android-4-armeabi</tt>, the <tt>configure</tt> command line would look like this:
If you followed the [[#Optional libraries|above description]] and have those libraries in <tt>/opt/android/3rd-android-4-armeabi</tt>, the <tt>configure</tt> command line would look like this:


  ./configure --host=android --enable-plugins --default-dynamic --with-tremor-prefix=/opt/android/3rd-android-4-armeabi --with-mad-prefix=/opt/android/3rd-android-4-armeabi --with-flac-prefix=/opt/android/3rd-android-4-armeabi
  ./configure --host=android-arm-v7a --with-tremor-prefix=/opt/android/3rd-android-4-armeabi --with-mad-prefix=/opt/android/3rd-android-4-armeabi --with-flac-prefix=/opt/android/3rd-android-4-armeabi
 
Supported hosts:
* <tt>android-arm-v7a</tt> - for older Android devices
* <tt>android-arm64-v8a</tt> - for all new Android devices
* <tt>android-x86</tt> - ideal for emulator with 32bit images
* <tt>android-x86_64</tt> - ideal for emulator with 64bit images
 
= Android Studiosetup  =
 
After compiling there in the build directory (if used) there will be a new directory called <tt>android-project</tt>, this can be opened by Android Studio. C files are not yet available , but it sis possible edit Java files and debug both Java & native code (in emulator or on a real device via <tt>adb</tt> connection).
To enable debugging, after opening the <tt>android-project</tt> directory change <tt>Project configuration</tt>, under tab <tt>Debugger</tt>, set field <tt>Debug type</tt> to <tt>Dual</tt>
47

edits

Navigation menu