Changes between Version 239 and Version 240 of AndroidPort


Ignore:
Timestamp:
Oct 27, 2013, 9:35:03 PM (11 years ago)
Author:
Philip Taylor
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndroidPort

    v239 v240  
    152152{{{
    153153$ cd ~/android
    154 $ tar -xvf android-sdk_r16-linux.tgz
     154$ tar -xvf android-sdk_r22.2.1-linux.tgz
    155155}}}
    156156Now complete the installation by running the `android` tool:
     
    163163Google publishes a [http://developer.android.com/sdk/ndk/index.html Native Development Kit] (NDK), which is a set of tools for building native applications for the Android platform. Unfortunately, the official NDK does not and will not support the `std::wstring` (wide characters) datatype, which is required by the game, so we'll have to use the unofficial [http://www.crystax.net/android/ndk.php Crystax NDK]. This is merely an extension of the official NDK, adding support for wide characters and other features maligned by Google.
    164164
    165 Download the `5.beta2` Crystax NDK release from [http://www.crystax.net/en/android/ndk this page] to the working directory and then unpack there, e.g.:
     165Download the r8-crystax-1 NDK release from [http://www.crystax.net/en/android/ndk this page] to the working directory and then unpack there, e.g.:
    166166{{{
    167167$ cd ~/android
    168 $ tar -xvf android-ndk-r7-crystax-5.beta2-linux-x86.tar.bz2
     168$ tar -xvf android-ndk-r8-crystax-1-linux-x86_64.tar.bz2
    169169}}}
    170170
     
    193193(These instructions are pretty imprecise, but in practice it's possible to get them to work with at least some versions of the game.)
    194194
    195 First download a recent version of SDL 2.0:
     195First download SDL 2.0:
    196196{{{
    197197cd build/android/sdl-project/jni/
    198 hg clone http://hg.libsdl.org/SDL
     198wget http://www.libsdl.org/release/SDL2-2.0.1.tar.gz
     199tar xvf SDL2-2.0.1.tar.gz
     200mv SDL2-2.0.1 SDL
    199201}}}
    200202
     
    219221
    220222cd gcc/
    221 TOOLCHAIN=${HOME}/android/toolchain-0ad PKG_CONFIG_LIBDIR=${TOOLCHAIN}/sysroot/usr/local/lib/pkgconfig LDFLAGS="-lSDL2 -L=/usr/local/lib -L../../android/sdl-project/libs/armeabi" INCLUDES="--sysroot=${TOOLCHAIN}/sysroot -I${TOOLCHAIN}/arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi/armv7-a/ -I../../android/sdl-project/jni/SDL/include -isystem=/usr/local/include/boost-1_45" CXX=${TOOLCHAIN}/bin/arm-linux-androideabi-g++ make pyrogenesis -j3 config=debug
     223TOOLCHAIN=${HOME}/android/toolchain-0ad PKG_CONFIG_LIBDIR=${TOOLCHAIN}/sysroot/usr/local/lib/pkgconfig LDFLAGS="-lSDL2 -L=/usr/local/lib -L../../android/sdl-project/libs/armeabi" INCLUDES="--sysroot=${TOOLCHAIN}/sysroot -I${TOOLCHAIN}/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi/armv7-a/ -I../../android/sdl-project/jni/SDL/include -isystem=/usr/local/include/boost-1_45" CXX=${TOOLCHAIN}/bin/arm-linux-androideabi-g++ make pyrogenesis -j3 config=debug
    222224}}}
    223225
     
    226228The .apk is basically just the standard SDL android-project, and it loads `/data/local/libpyrogenesis_dbg.so` which contains all the engine code. That means you can recompile and then upload the engine code (via "`make push-so`") on the host PC, and don't have to manually reinstall the app after each change. If you want a non-debug build, remove the "`config=debug`" when building the game, then copy `binaries/system/libpyrogenesis.so` to `libpyrogenesis_dbg.so` before running "`make push-so`".
    227229
    228 You need to use the game engine to create `public.zip` for data files, since it has to convert all the textures/models/animations/etc into a different format before zipping them up. Build a standard non-Android copy of the game, then run it like "`binaries/system/pyrogenesis -archivebuild=binaries/data/mods/public -archivebuild-output=temp/public.zip -archivebuild-compress`" and it should print lots of output and will take a while (maybe ten minutes or more). Then copy to `/sdcard/0ad/data/mods/public/public.zip` and the game should see it. (If you want to change a few data files after that, you don't need to regenerate `public.zip` - just copy the individual files straight into `mods/public/` and they'll override the zipped version.)
     230You need to use the game engine to create `public.zip` for data files, since it has to convert all the textures/models/animations/etc into a different format before zipping them up. Build a standard non-Android copy of the game, then run it like
     231{{{
     232mkdir temp
     233binaries/system/pyrogenesis -archivebuild=binaries/data/mods/public -archivebuild-output=temp/public.zip -archivebuild-compress
     234}}}
     235and it should print lots of output and will take a while (maybe ten minutes or more). Then copy to `/sdcard/0ad/data/mods/public/public.zip` and the game should see it. (If you want to change a few data files after that, you don't need to regenerate `public.zip` - just copy the individual files straight into `mods/public/` and they'll override the zipped version.)
    229236
    230237Also, copy `binaries/data/config/default.cfg` into `/sdcard/0ad/appdata/config/`, and optionally set any local configuration values in `/sdcard/0ad/appdata/config/local.cfg`.