1 D2DF-SDL for ANDROID
2 --------------------
4 Doom 2D Forever port for Android 4.0+
6 Building
7 --------
9 Tools, files and libraries used for official builds:
10 * Android Platform Tools r21 (adb)
11 * Android Build Tools r21 (dx, aapt)
12 * Android Platform 19 (android.jar)
13 * OpenJDK 8 (javac, jarsigner)
14 * Crystax NDK 10.3.2
15 * FPC 3.2.2
16 * SDL 2.0.7
17 * SDL_mixer 2.0.4
18 * libenet 1.3.17
19 * libminiupnpc 2.2.3
21 Official packages builded for following Android ABIs (fpc options):
22 * armeabi (-CpARMV5TE -CfSOFT -CaEABI -O2) [1]
23 * armeabi-v7a (-CpARMV7A -CfVFPV3_D16 -CaEABI -O2) [1]
24 * arm64-v8a (-CpARMV8 -CfVFP -O2) [2]
25 * mips (-CpMIPS32 -CfMIPS3 -O2) [1][3][not tested]
26 * x86 (-CpPENTIUM4 -CfSSSE3 -O-) [1][4][5]
27 * x86_64 (-CpCOREI -CfSSE42 -O-) [2][4][5][not tested]
29 [1] 32-bit builds linked with Android Platform 14 shared libraries
30 [2] 64-bit builds linked with Android Platform 21 shared libraries
31 [3] FPU instruction set can be incorrect for generic builds
32 [4] CPU instruction set can be incorrect for generic builds
34 Build all shared libraries using NDK toolchain and put into directory ./ass/lib/armeabi-v7a/.
35 Also you need to build FPC crosscompiler ( http://wiki.freepascal.org/Android ).
37 If you want to pack game resources into APK, add it into directory "resources".
38 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).
40 Generate your personal keys (only onece):
41 ```
42 keytool -genkey -validity 10000 \
43 -dname "CN=AndroidDebug, O=Android, C=US" \
44 -keystore d2df.keystore \
45 -storepass android \
46 -keypass android \
47 -alias androiddebugkey \
48 -keyalg RSA \
49 -keysize 2048 \
50 -v
51 ```
53 Build D2DF for android armeabi-v7a:
54 ```
55 rm -rf tmp
56 mkdir -p tmp
57 cd ../src/game
58 ppcrossarm -g -gl -O2 \
59 -Tandroid -CpARMV7A -CfVFPV3_D16 -CaEABI \
60 -dUSE_SDL2 -dUSE_SDLMIXER -dUSE_GLES1 -dUSE_MINIUPNPC -O2 \
61 -FU../../android/tmp \
62 -FE../../android/ass/lib/armeabi-v7a \
63 -Fl../../android/ass/lib/armeabi-v7a \
64 -olibDoom2DF.so \
65 Doom2DF.lpr
66 ```
68 Build APK and sign it (${ANDROID_JAR} are path to android.jar):
69 ```
70 rm -rf bin obj gen
71 mkdir -p bin obj gen resources
72 aapt package -f -m -S res -J gen -M AndroidManifest.xml -I ${ANDROID_JAR}
73 javac -source 1.6 -target 1.6 -d obj -bootclasspath ${ANDROID_JAR} -sourcepath src `find src -name '*.java'`
74 dx --dex --output=bin/classes.dex obj
75 aapt package -f \
76 -M AndroidManifest.xml \
77 -S res \
78 -J gen \
79 -I ${ANDROID_JAR} \
80 -F bin/d2df.unsigned.apk \
81 -A resources
82 bin ass
83 jarsigner -sigalg SHA1withRSA -digestalg SHA1 \
84 -keystore d2df.keystore \
85 -storepass android \
86 -keypass android \
87 -signedjar bin/d2df.signed.apk \
88 bin/d2df.unsigned.apk androiddebugkey
89 ```
91 Install APK on your device via adb:
92 ```
93 adb install -r bin/d2df.signed.apk
94 ```