[Android] Installation de Slash'em. Distribution de travail : Lubuntu 14.04 1) Répertoire de travail :
[~] ➔ mkdir ANDROID.slash
[~] ➔ cd ANDROID.slash/
[~/ANDROID.slash] ➔
2) Téléchargement de l'Android NDK 1.6 :
[~/ANDROID.slash] ➔ wget http://dl.google.com/android/ndk/android-ndk-1.6_r1-linux-x86.zip
[~/ANDROID.slash] ➔ unzip android-ndk-1.6_r1-linux-x86.zip
3) Téléchargement de l'Android SDK r13 :
[~/ANDROID.slash] ➔ wget http://dl.google.com/android/android-sdk_r13-linux_x86.tgz
[~/ANDROID.slash] ➔ tar xvfz android-sdk_r13-linux_x86.tgz
4) Mise-à-jour du SDK :
[~/ANDROID.slash] ➔ android-sdk-linux_x86/tools/android update sdk -u -t platform,platform-tool,extra
[~/ANDROID.slash] ➔ android-sdk-linux_x86/tools/android
- Installed packages
- Android SDK Platform-tools, revision 19
- Android SDK Tools, revision 22
*[Update All...]
- Fermer
5) Téléchargement des paquets 'Tools', 'Platform tools' et 'Build tools' :
[~/ANDROID.slash] ➔ android-sdk-linux_x86/tools/android
- Android SDK Tools 22 -> 24.0.2: V
- Android SDK Platform-tools 19 -> 20 : V
- Android SDK Build-tools 19.1 : V
- Android SDK, Andoid 2.2 (API 8) : V
- [Install 5 packages]
- Accept license : O
- [Install]
- Fermer
6) Téléchargement et installation d'Eclipse SDK 3.7.2 :
[~/ANDROID.slash] ➔ wget http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-linux-gtk.tar.gz
[~/ANDROID.slash] ➔ mv download.php?file=%2Feclipse%2Fdownloads%2Fdrops%2FR-3.7.2-201202080800%2Feclipse-SDK-3.7.2-linux-gtk.tar.gz eclipse-SDK-3.7.2-linux-gtk.tar.gz
[~/ANDROID.slash] ➔ tar xvfz eclipse-SDK-3.7.2-linux-gtk.tar.gz
[~/ANDROID.slash] ➔ mkdir workspace
7) Variable d'environnement :
export PATH=${PATH}:${HOME}/ANDROID.slash/android-sdk-linux_86/tools/
export PATH=${PATH}:${HOME}/bin
export ANDROID_HOME=/home/nekrofage/ANDROID.slash/android-sdk-linux_x86
export ANDROID_NDK_ROOT=/home/nekrofage/ANDROID.slash/android-ndk-1.6_r1
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
8) Téléchargement du code source de 'Slash em' :
[~/ANDROID.slash] ➔ wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/nethack-android/slashem-android-1.2.3.tar.gz
[~/ANDROID.slash] ➔ tar xvfz slashem-android-1.2.3.tar.gz
9) Configuration du jeu :
[~/ANDROID.slash] ➔ cd slashem-0.0.7E7F3/sys/android/
[~/ANDROID.slash/slashem-0.0.7E7F3/sys/android] ➔
Ouvrir :
setup.sh
Chercher :
ANDROID_NDK_DIR=$(echo ~)/android-ndk-1.6_r1
Remplacer par :
ANDROID_NDK_DIR=$(echo ~)/ANDROID.slash/android-ndk-1.6_r1
10) Post-configuration :
[~/ANDROID.slash/slashem-0.0.7E7F3/sys/android] ➔ chmod 777 setup.sh
[~/ANDROID.slash/slashem-0.0.7E7F3/sys/android] ➔ ./setup.sh
Copying Makefiles.
Setting absolute path
Setting up links
11) Compilation des données :
[~/ANDROID.slash/slashem-0.0.7E7F3/sys/android] ➔ cd ../../dat/
[~/ANDROID.slash/slashem-0.0.7E7F3/dat] ➔ gcc --version
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
[~/ANDROID.slash/slashem-0.0.7E7F3/dat] ➔ make
(cd ../util ; make makedefs)
...
12) Compilation de la librairie :
[~/ANDROID.slash/slashem-0.0.7E7F3/dat] ➔ cd ../../android-ndk-1.6_r1/
[~/ANDROID.slash/android-ndk-1.6_r1] ➔ ./build/host-setup.sh --no-awk-check
[~/ANDROID.slash/android-ndk-1.6_r1] ➔ make APP=SlashEMNative
Android NDK: Building for application 'SlashEMNative'
Compile thumb : slashem <= /home/nekrofage/ANDROID.slash/slashem-0.0.7E7F3/sys/android/NetHackNative/nethack/../sys/android/NetHackNative/androidmain.c
...
SharedLibrary : libslashem.so
Install : libslashem.so => /home/nekrofage/ANDROID.slash/slashem-0.0.7E7F3/sys/android/NetHackNative/libs/armeabi
13) Lancement et configuration d'Eclipse :
[~/ANDROID.slash/android-ndk-1.6_r1] ➔ cd ..
[~/ANDROID.slash] ➔ rm ~/.eclipse/ -rf
[~/ANDROID.slash] ➔ ./eclipse/eclipse
- Workspace : /home/nekrofage/ANDROID.slash/workspace
- Use this as the default and do not ask again : V
- [OK]
14) Installation de l’extension ‘Android Develpment Tool’ (ADT) :
- [Help][Install New Software...]
- [Add...]
- Name : Android ADT
Location : https://dl-ssl.google.com/android/eclipse/
- [OK]
- Developer Tools : V
- [Next >]
- [Next >]
- I accept the terms of the license agreements : O
- [Finish]
- You will need to restart Eclipse SDK for the installatin changes to take effect : [Restart Now]
15) Post-configuration :
- [Windows][Preference]
- SDK Location : /home/nekrofage/ANDROID.slash/android-sdk-linux_x86
16) Importation du projet 'Android Slashem' :
- [File][New][Project...]
- [Android][Android Project from Existing Code]
- [Next >]
- Root Directory : /home/nekrofage/ANDROID.slash/slashem-0.0.7E7F3/sys/android/NetHackApp
- [Valider]
- [Finish]
17) Compilatin du projet :
- Sélectionner le projet : NetHackApp
- [Project][Build Project]
- [Run][Run As][Android Application]
18) Vérification :
[~/ANDROID.slash] ➔ ls -l slashem-0.0.7E7F3/sys/android/NetHackApp/bin/
total 2768
-rw-rw-r-- 1 nekrofage nekrofage 940 avril 13 01:00 AndroidManifest.xml
drwxrwxr-x 3 nekrofage nekrofage 4096 avril 13 01:00 classes
-rw-rw-r-- 1 nekrofage nekrofage 115640 avril 13 01:03 classes.dex
drwxrwxr-x 2 nekrofage nekrofage 4096 avril 13 01:03 dexedLibs
-rw-rw-r-- 1 nekrofage nekrofage 1963230 avril 13 01:03 NetHackApp.apk
drwxrwxr-x 3 nekrofage nekrofage 4096 avril 13 01:03 res
-rw-rw-r-- 1 nekrofage nekrofage 732561 avril 13 01:03 resources.ap_
[~/ANDROID.slash] ➔
19) Copier la paquet 'NetHackApp.apk' vers le téléphone.
20) Installer et exécuter 'NetHackApp.apk'.
21) Capture d'écran :
22) Renommer le projet.
- Sélectionner le projet : NetHackApp
- [Refactor][Rename...]
- New name : SlashEmApp