Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAndroid build standup #24674
Conversation
ZhilkinSerg
added
Code: Build
OS: Android
labels
Aug 7, 2018
This comment has been minimized.
This comment has been minimized.
|
I'm a little confused as to what this PR does. Does this add an automagical Android build of the game whenever it updates, or just provide instructions for compiling my own APK and the resources to do so? |
This comment has been minimized.
This comment has been minimized.
|
The latter. With this change you can manually compile and run Cataclysm DDA
on an Android device. If/when this PR is accepted, I'll work on getting nightly experimental Android builds up and
running alongside the other desktop builds. This PR is the first step to making that happen.
…On Tue., 7 Aug. 2018, 10:24 pm Inglonias, ***@***.***> wrote:
I'm a little confused as to what this PR does. Does this add an
automagical Android build of the game whenever it updates, or just provide
instructions for compiling my own APK and the resources to do so?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24674 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGAQSW_A3wJaRb9cMExeosZE275ZA304ks5uOYcGgaJpZM4VxriX>
.
|
a1studmuffin
force-pushed the
a1studmuffin:android-build-standup
branch
Aug 15, 2018
ZhilkinSerg
added
the
(P2 - High)
label
Aug 17, 2018
This comment has been minimized.
This comment has been minimized.
|
Sorry for waiting for too long in the PR queue. I have Linux VM ready now, so I will try to compile this next week. |
a1studmuffin
added some commits
Jul 16, 2018
a1studmuffin
force-pushed the
a1studmuffin:android-build-standup
branch
to
dd27233
Aug 26, 2018
This comment has been minimized.
This comment has been minimized.
|
No problem at all, it's a decent chunk of code so I figured it'd be a while before someone had the time to check it out - thanks for having a look! I'll continue keeping the PR updated to latest to ensure there's no merge conflicts. Let me know if you run into any issues. |
a1studmuffin
changed the title
[WIP] Android build standup
Android build standup
Aug 26, 2018
ZhilkinSerg
reviewed
Aug 27, 2018
| wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | ||
| unzip sdk-tools-linux-4333796.zip -d ~/android-sdk | ||
| rm sdk-tools-linux-4333796.zip | ||
| ~/android-sdk/tools/bin/sdkmanager --update |
This comment has been minimized.
This comment has been minimized.
ZhilkinSerg
Aug 27, 2018
Contributor
zhilkin@ubuntu:~$ ~/android-sdk/tools/bin/sdkmanager --update
Warning: File /home/zhilkin/.android/repositories.cfg could not be loaded.
[=======================================] 100% Computing updates...
This comment has been minimized.
This comment has been minimized.
a1studmuffin
Aug 28, 2018
Author
Contributor
I believe this warning is "normal" for this Android toolchain version. It appears if the file it's looking for doesn't exist locally, but doesn't impact anything after that: https://askubuntu.com/questions/885658/android-sdk-repositories-cfg-could-not-be-loaded
This comment has been minimized.
This comment has been minimized.
ZhilkinSerg
reviewed
Aug 27, 2018
| export PATH=$PATH:$ANDROID_SDK_ROOT/tools | ||
| export PATH=$PATH:$ANDROID_NDK_ROOT | ||
|
|
||
| Install custom Android dependencies. From the root folder of the CDDA repository run: |
This comment has been minimized.
This comment has been minimized.
ZhilkinSerg
Aug 27, 2018
Contributor
I believe we should switch to Cataclysm-DDA folder before cloning.
This comment has been minimized.
This comment has been minimized.
a1studmuffin
Aug 28, 2018
•
Author
Contributor
Ah thanks, that's what I meant to say with "From the root folder of the CDDA repository run:". I've updated it in 583c4b6.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I've built a branch off of this PR that uses precompiled dependencies(easier end user builds, and likely easier for the CI machinery to deal with), and adds some per build type flags for optimization. I'll PR it at your repo once I've finished testing everything out, if you're interested?(I felt I should say something early, before you rebase again.) |
ZhilkinSerg
reviewed
Aug 29, 2018
This comment has been minimized.
This comment has been minimized.
|
Successfully created, installed and run Release version. Initially had some troubles with signing apk, but read the instructions and everything went smooth. |
This comment has been minimized.
This comment has been minimized.
|
@a1studmuffin Turns the build process into a one step operation(build environment not included.) |
kevingranade
merged commit 583c4b6
into
CleverRaven:master
Sep 9, 2018
This comment has been minimized.
This comment has been minimized.
|
Woohoo! Thanks to everyone who tested this out, much appreciated. |



a1studmuffin commentedAug 7, 2018
•
edited
Hey team, I've spent the last few weeks burning the midnight oil standing up the Android build in mainline. With this PR you can now compile and run Cataclysm DDA on an Android device. See my additions to COMPILING.md for an overview and instructions on how to build an Android APK under Linux.
There is a new folder in the root of the repository
android/which contains the Android project files.The rest of the changes are to game C++ files in
src/(as well as an Android.mk file). Almost all of the C++ changes are guarded for__ANDROID__so they won't affect other platforms, with the exception of one or two minor additions.I'd appreciate if anyone wants to skim over the changes and offer feedback. If you're attempting to get this running under Windows with Android Studio (I've got it building under Ubuntu and Windows here), ensure your git supports creation of symlinks.
Most of the C++ changes to random game files are just setting up input_contexts specifically for Android, often with manually registered buttons + descriptions to match the existing UI code. This is so that the Android quick shortcuts along the bottom of the touchscreen work even in cases where the game's UI code hasn't been refactored to use an input_context yet. I considered rewriting each of these UI screens to use input_contexts for all platforms, but that's a reasonably big job and I was hoping we could tackle it later on.
There's also a big hunk of Android-specific code sitting in sdltiles.cpp. Let me know if this is unpalatable and I can look at merging some of it into a separate C++ file containing Android-specific code, perhaps android.cpp/h.
Things that are still outstanding (but can happen after this PR):
Completed: