1 D2DF-SDL for ANDROID
2 --------------------
4 Doom 2D Forever ported to Android 4.1+.
6 Building
7 --------
9 Requirements:
10 * Android SDK build-tools >= 19.1.0;
11 * Android SDK platforms >= android-16;
12 * Android NDK >= r16b;
13 * Open JDK >= 8;
14 * FPC >= 3.0.4;
15 * SDL >= 2.0.7;
16 * SDL_mixer >= 2.0;
17 * libenet >= 1.3.13.
19 Build all shared libraries using NDK toolchain and put into directory ./ass/lib/armeabi-v7a/.
20 Also you need to build FPC crosscompiler ( http://wiki.freepascal.org/Android ).
22 If you want to pack game resources into APK, add it into directory "resources".
23 If you want to play MIDI music, add instruments and timidity.cfg into directory "resources" (you can grab it from https://www.libsdl.org/projects/SDL_mixer/timidity/timidity.tar.gz).
25 Generate keys:
26 ```
27 keytool -genkey -validity 10000 \
28 -dname "CN=AndroidDebug, O=Android, C=US" \
29 -keystore d2df.keystore \
30 -storepass android \
31 -keypass android \
32 -alias androiddebugkey \
33 -keyalg RSA \
34 -keysize 2048 \
35 -v
36 ```
38 Build D2DF:
39 ```
40 rm -rf tmp
41 mkdir -p tmp
42 cd ../src/game
43 ppcrossarm \
44 -g -gl -dUSE_SDLMIXER -dUSE_GLES1 -O3 \
45 -Tandroid \
46 -Cparmv7a \
47 -Cfvfpv3 \
48 -Fi../lib/vampimg \
49 -Fi../lib/vampimg/JpegLib \
50 -Fi../lib/vampimg/ZLib \
51 -Fu../lib/vampimg \
52 -Fu../lib/vampimg/JpegLib \
53 -Fu../lib/vampimg/ZLib \
54 -FU../../android/tmp \
55 -FE../../android/ass/lib/armeabi-v7a \
56 -Fl../../android/ass/lib/armeabi-v7a \
57 -olibDoom2DF.so \
58 Doom2DF.lpr
59 ```
61 Build APK and sign it:
62 ```
63 rm -rf bin obj gen
64 mkdir -p bin obj gen resources
65 aapt package -f -m -S res -J gen -M AndroidManifest.xml -I ${ANDROID_JAR}
66 javac -source 1.6 -target 1.6 -d obj -bootclasspath ${ANDROID_JAR} -sourcepath src `find src -name '*.java'`
67 dx --dex --output=bin/classes.dex obj
68 aapt package -f \
69 -M AndroidManifest.xml \
70 -S res \
71 -J gen \
72 -I ${ANDROID_JAR} \
73 -F bin/d2df.unsigned.apk \
74 -A resources
75 bin ass
76 jarsigner -sigalg SHA1withRSA -digestalg SHA1 \
77 -keystore d2df.keystore \
78 -storepass android \
79 -keypass android \
80 -signedjar bin/d2df.signed.apk \
81 bin/d2df.unsigned.apk androiddebugkey
82 ```
84 Where ${ANDROID_JAR} is path to android.jar file. Typically placed in ~/Android/android-sdk/platforms/android-16/android.jar.