User Tools

Site Tools


development:compiling:player:android

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
development:compiling:player:android [2015/03/12 16:41] – created blisterdevelopment:compiling:player:android [2016/04/01 17:33] (current) – remove boost fdelapena
Line 1: Line 1:
-======= How to build/work on the Android Build =======+======= Building/working on the Android Port =======
  
 Note : We recommend you to put the "android-toolchain" and "player" directories in the same directory. Note : We recommend you to put the "android-toolchain" and "player" directories in the same directory.
Line 6: Line 6:
 ==== a) Install the Android SDK ==== ==== a) Install the Android SDK ====
  
-Download et follow the official instructions to install the Android SDK :+Download and follow the official instructions to install the Android SDK :
 http://developer.android.com/sdk/installing/index.html?pkg=tools http://developer.android.com/sdk/installing/index.html?pkg=tools
  
-In the SDK directory, execute the "android" file, it displays a GUI. Use it to download the API 10 (or later).+In the SDK directory, execute the "android" file, it displays a GUI. Use it to download the API 12 (or later).
 If you want to launch the application on a Virtual Machine, download the ARM EABI System Image. If you want to launch the application on a Virtual Machine, download the ARM EABI System Image.
  
Line 36: Line 36:
 Execute this script : Execute this script :
  WORKSPACE=$(pwd)  WORKSPACE=$(pwd)
- 
  # Compile easyrpg dependencies  # Compile easyrpg dependencies
  ndk-build  ndk-build
  cp obj/local/armeabi-v7a/*.a libs/armeabi-v7a/  cp obj/local/armeabi-v7a/*.a libs/armeabi-v7a/
- wget http://download.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz 
- tar xf boost_1_55_0.tar.gz 
- cp -r boost_1_55_0/boost/ include/boost/ 
- 
  ## Compile icu  ## Compile icu
  # Native  # Native
Line 53: Line 48:
  make  make
  export ICU_CROSS_BUILD=$PWD  export ICU_CROSS_BUILD=$PWD
- 
  # Android  # Android
  cd ../../icu4c-53.1/source  cd ../../icu4c-53.1/source
- 
  export CPPFLAGS="-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include -I$NDK_ROOT/sources/cxx-stl/stlport/stlport -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib"  export CPPFLAGS="-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include -I$NDK_ROOT/sources/cxx-stl/stlport/stlport -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib"
  export CXXFLAGS="$CPPFLAGS"  export CXXFLAGS="$CPPFLAGS"
  export CFLAGS="$CXXFLAGS"  export CFLAGS="$CXXFLAGS"
  export LDFLAGS="-lc -Wl,-rpath-link=$NDK_ROOT/platforms/android-8/arch-arm/usr/lib/ -L $NDK_ROOT/platforms/android-8/arch-arm/usr/lib/"  export LDFLAGS="-lc -Wl,-rpath-link=$NDK_ROOT/platforms/android-8/arch-arm/usr/lib/ -L $NDK_ROOT/platforms/android-8/arch-arm/usr/lib/"
- 
  chmod u+x configure  chmod u+x configure
  ./configure --with-cross-build=$ICU_CROSS_BUILD --enable-strict=no  --enable-static --enable-shared=no --enable-tests=no --enable-samples=no --enable-dyload=no --enable-tools=no --host=arm-linux-androideabi --with-data- packaging=static  ./configure --with-cross-build=$ICU_CROSS_BUILD --enable-strict=no  --enable-static --enable-shared=no --enable-tests=no --enable-samples=no --enable-dyload=no --enable-tools=no --host=arm-linux-androideabi --with-data- packaging=static
- 
  mv $NDK_ROOT/platforms/android-8/arch-arm/usr/include/util.h _util.h #To prevent a build error  mv $NDK_ROOT/platforms/android-8/arch-arm/usr/include/util.h _util.h #To prevent a build error
  make  make
Line 71: Line 62:
   
 ===== 2) Build the Android Port ===== ===== 2) Build the Android Port =====
-Return to your working directory (which should contains the android-toolchain directory)+Return to your working directory (which should contain the android-toolchain directory)
  
 Export the android-toolchain directory, it should be : Export the android-toolchain directory, it should be :
Line 82: Line 73:
  keytool -genkey -v -keystore easyrpg.keystore -alias nightly -keyalg RSA -keysize 2048 -validity 10000  keytool -genkey -v -keystore easyrpg.keystore -alias nightly -keyalg RSA -keysize 2048 -validity 10000
 Export the path of the generated keystore. Export the path of the generated keystore.
- export PATH_KEYSTORE=($pwd)/easyrpg.keystore+ export PATH_KEYSTORE=$(pwd)/easyrpg.keystore
 And the password you gave when you generated the keystore : And the password you gave when you generated the keystore :
  export MDP=the_password  export MDP=the_password
 +
 +Clone the Player repository :
 + git clone https://github.com/EasyRPG/Player.git
 + cd Player
  
 Then execute this script : Then execute this script :
  WORKSPACE=$(pwd)  WORKSPACE=$(pwd)
- 
  #Clone of liblcf  #Clone of liblcf
  mkdir -p lib  mkdir -p lib
  git clone https://github.com/EasyRPG/liblcf lib/liblcf  git clone https://github.com/EasyRPG/liblcf lib/liblcf
- 
  cd builds/android  cd builds/android
- 
  #Download of timidity  #Download of timidity
  git clone https://github.com/Ghabry/timidity_gus.git assets/timidity  git clone https://github.com/Ghabry/timidity_gus.git assets/timidity
  
- #Configuration +You have to specify the API Target you will use to build the Player, for now we use the API 12, use "android list targets" to know the number associated with installed API. We assume this number is 1 :
- GIT_DESCRIBE_VERSION=`git describe | cut -d - -f -2 | sed s/-/./g` +
- GIT_COMMIT_COUNT=`git rev-list HEAD --count` +
- mv AndroidManifest.xml AndroidManifest.orig.xml +
- cat AndroidManifest.orig.xml | sed -e 's/android:versionCode=".*"/android:versionCode="'$GIT_COMMIT_COUNT'"/' | sed -e 's/android:versionName=".*"/android:versionName="'$GIT_DESCRIBE_VERSION'"/' > AndroidManifest.xml +
- +
-You have to specify the API Target you will use to build the Player, for now we use the API 10, use "android list targets" to know the number associated with installed API. We assume this number is 1 :+
  android update project --path "." --target 1  android update project --path "." --target 1
 +NB : We're targeting API 12 (to have gamepad support from SDL lib), but the minimum supported SDK is API 10.
  
 Build the project : Build the project :
Line 111: Line 98:
  ant clean  ant clean
  ant release  ant release
- 
  cd bin  cd bin
  jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $PATH_KEYSTORE -storepass $MDP SDLActivity-release-unsigned.apk nightly  jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $PATH_KEYSTORE -storepass $MDP SDLActivity-release-unsigned.apk nightly
development/compiling/player/android.1426178519.txt.gz · Last modified: 2015/03/12 16:41 by blister

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki