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 -FU../../android/tmp \
49 -FE../../android/ass/lib/armeabi-v7a \
50 -Fl../../android/ass/lib/armeabi-v7a \
51 -olibDoom2DF.so \
52 Doom2DF.lpr
53 ```
55 Build APK and sign it:
56 ```
57 rm -rf bin obj gen
58 mkdir -p bin obj gen resources
59 aapt package -f -m -S res -J gen -M AndroidManifest.xml -I ${ANDROID_JAR}
60 javac -source 1.6 -target 1.6 -d obj -bootclasspath ${ANDROID_JAR} -sourcepath src `find src -name '*.java'`
61 dx --dex --output=bin/classes.dex obj
62 aapt package -f \
63 -M AndroidManifest.xml \
64 -S res \
65 -J gen \
66 -I ${ANDROID_JAR} \
67 -F bin/d2df.unsigned.apk \
68 -A resources
69 bin ass
70 jarsigner -sigalg SHA1withRSA -digestalg SHA1 \
71 -keystore d2df.keystore \
72 -storepass android \
73 -keypass android \
74 -signedjar bin/d2df.signed.apk \
75 bin/d2df.unsigned.apk androiddebugkey
76 ```
78 Where ${ANDROID_JAR} is path to android.jar file. Typically placed in ~/Android/android-sdk/platforms/android-16/android.jar.