Changes between Version 239 and Version 240 of AndroidPort
- Timestamp:
- Oct 27, 2013, 9:35:03 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AndroidPort
v239 v240 152 152 {{{ 153 153 $ cd ~/android 154 $ tar -xvf android-sdk_r 16-linux.tgz154 $ tar -xvf android-sdk_r22.2.1-linux.tgz 155 155 }}} 156 156 Now complete the installation by running the `android` tool: … … 163 163 Google 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. 164 164 165 Download the `5.beta2` CrystaxNDK release from [http://www.crystax.net/en/android/ndk this page] to the working directory and then unpack there, e.g.:165 Download 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.: 166 166 {{{ 167 167 $ cd ~/android 168 $ tar -xvf android-ndk-r 7-crystax-5.beta2-linux-x86.tar.bz2168 $ tar -xvf android-ndk-r8-crystax-1-linux-x86_64.tar.bz2 169 169 }}} 170 170 … … 193 193 (These instructions are pretty imprecise, but in practice it's possible to get them to work with at least some versions of the game.) 194 194 195 First download a recent version ofSDL 2.0:195 First download SDL 2.0: 196 196 {{{ 197 197 cd build/android/sdl-project/jni/ 198 hg clone http://hg.libsdl.org/SDL 198 wget http://www.libsdl.org/release/SDL2-2.0.1.tar.gz 199 tar xvf SDL2-2.0.1.tar.gz 200 mv SDL2-2.0.1 SDL 199 201 }}} 200 202 … … 219 221 220 222 cd 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=debug223 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.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 222 224 }}} 223 225 … … 226 228 The .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`". 227 229 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.) 230 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 231 {{{ 232 mkdir temp 233 binaries/system/pyrogenesis -archivebuild=binaries/data/mods/public -archivebuild-output=temp/public.zip -archivebuild-compress 234 }}} 235 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.) 229 236 230 237 Also, 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`.