Skip to content

Instantly share code, notes, and snippets.

@jacob1
Last active June 9, 2021 13:59
Show Gist options
  • Save jacob1/7556fd14c3589818c4d2 to your computer and use it in GitHub Desktop.
Save jacob1/7556fd14c3589818c4d2 to your computer and use it in GitHub Desktop.
Android compiling instructions
1) Go to https://developer.android.com/studio/index.html and scroll down to
"Get just the command line tools", download the linux sdk.
2) Go to https://developer.android.com/ndk/downloads/index.html#download and
download the linux 64 bit NDK.
3) Extract the SDK into some folder (it isn't installed)
4) Extract the NDK into some folder (it isn't installed)
5) Run android.sh inside the tools folder in the sdk. Uncheck the preview SDK if
there is one (you don't need it, this stuff takes up a lot of space). Uncheck
the emulators you don't need (Android tv, android wear, google APIs), they are
about 1GB each. Hit install. This part will take the longest to download (many
gigabytes of download, unless you don't want the emulators).
6) Run 'git clone https://github.com/jacob1/android-sdl --depth 1' somewhere.
This is a massive git repo with tons of unnecessary code for other projects in
it so might take a long time, the --depth 1 will tell it not to download old
history. All the extremely large downloads are done now.
6) Run 'git clone https://github.com/jacob1/The-Powder-Toy.git'
7) Create an .sh script with something like this inside (adjust for your sdk):
export PATH=$PATH:~/code/android/android-ndk-r11c:~/code/android/android-sdk-linux/tools:~/code/android/android-sdk-linux/platform-tools:~/code/android/android-sdk-linux/build-tools/23.0.3
Run 'source env.sh' every time you do compiling. You could also add it to your
path permanently
8) Run these commands, adjust the first one for the location where you put the
TPT source code:
ln -s /home/jacob/code/android/The-Powder-Toy project/jni/application/powdertoy
ln -s powdertoy project/jni/application/src
9) Run './changeAppSettings.sh -a' . It will do some magical stuff and compile
all of the libraries
10) Run 'android update project -p project'
11) You might need debug.keystore to sign a debug build. Not sure how to do this,
previous notes I wrote said 'ant debug' should.
12) ./build.sh - hope it compiles. It will compile all the required libraries
first
Optional) Install an android emulator:
https://software.intel.com/en-us/android/articles/speeding-up-the-android-emulator-on-intel-architecture
Optional) to debug using gdb, compile with './build.sh debug'. Then do 'ndk-gdb --project=project'
TODO:
clipboard
int SDLCALL SDL_SetClipboardText(const char *text);
char * SDLCALL SDL_GetClipboardText(void);
int SDLCALL SDL_HasClipboardText(void);
key remapping interface
draggable things should work with scrollwheel (and add actual option for new menus in settings for computer)
vibrate on hold buttons?
things like menu buttons stay highlighted when mouse is released, should not
scrolly menu should have larger area where it is draggable
scrolly menu doesn't really work on computer with smaller BARSIZE
scrolly online saves
line/box button
flood fill button
new icons
eraser
console
keyboard
settings?
zoom
save stamp
load stamp
redo intro text
remove mod stuff
pressing volume keys locks mouse for 3 seconds, allows using zoom shortcuts to change mouse and zoom size
known bugs:
stuff in TODO
zoom / twist shortcuts change display modes -- annoying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment