Android Version

I tried to merge things in as per my earlier post, but I’m not experienced enough in coding to sift through all of the compilation errors.

Your work is greatly appreciated and I emailed you a while back and I’m sorry to hear that the maintainer of the project had a house fire.

would it be possible to make a barebones port without all of the UI and joystick stuff?
That way I could at least play on an android device with a keyboard.

Yeah, I think this is the logical first step to getting the Android build up and running in mainline. Ideally we’d get a nightly Android .apk building on ci.narc.ro, and the rest of the Android-specific UX functionality can be merged across bit by bit.

Things are coming along nicely, if anyone is curious I’m working on the Android branch for later integration into mainline here:

https://github.com/a1studmuffin/Cataclysm-DDA/tree/android-build-standup

Once I’ve done a bit more code cleanup and written up compiling documentation I’ll submit a work-in-progress PR to mainline for feedback from the core devs. After the PR has been merged into mainline, we can set up a continuous integration Android build on Jenkins alongside the other platforms.

In the interim, if anyone is desperate for a new build, here you go, currently it’s built on top of commit af2e593 (~6 days ago) but I’ll keep rebasing my changes on top of latest as I go… it’s currently working with tiles, lua, sound, localization:

https://drive.google.com/file/d/10TolS0sPxQWOuEfAlEpl6E7FmjTOBgsQ/view?usp=sharing (80MB APK)

Known issues and comments:

  • This build pretty much picks up where @Wulfe813 left things at with the old 0.4.9 build, aside from some under-the-hood changes that won’t affect gameplay.
  • Software renderer (the default) is a little fussy when switching to/from the app, sometimes it’ll give you a black screen after unlocking the screen or returning focus to the app. In this case just switch to/from the app again and it should resolve, otherwise you can try turning off the software renderer in the options to dodge the issue permanently.
  • A small number of devices (probably on Android 6.0) will still see garbled text when using hardware acceleration (software renderer off). This is an Android graphics driver bug I have no control over (which is why software renderer is the default), and there’s nothing we can do about it aside from maybe giving people an option on first install to choose what they want to use.
  • The APK package name is now “com.cleverraven.cataclysmdda”, so it will install alongside the old “com.MichaelDavies.CataclysmDDA” version if you’re still playing that. Try not to get confused, as uninstalling the wrong app will delete your save games! :slight_smile: You should be able to copy data from one to the other without many problems, the new one installs files to /sdcard/Android/data/com.cleverraven.cataclysmdda/files/
  • Physical keyboards seem to work fine, but physical mice seem to have an incorrect hotspot offset when mouse looking around, should be an easy fix though when I get time to look at it.

If anyone has any feedback or experiences weirdness/crashes, please let me know here or at a1studmuffin@gmail.com.

8 Likes

This is excellent news. Thanks for donating your time to a great cause!

Your work is greatly appreciated! I can’t spare much but would you like any donations through paypal or something?

The sooner we can mainline and get nightlies going the better, and if money can help that happen I’d be willing to pitch in!

It’s very kind of you to offer, but I’m happy doing this for free - I’ve gotten so much enjoyment from the game over the years that being able to help bring it to a larger audience is reward enough. My motivations are also selfish as I’d like to play latest experimental on my commute to/from work. :slight_smile:

1 Like

Would I still need an older version of the android SDK installed?
As one of the tools are deprecated for compiling the previous one and I could never get it to work with the latest SDK and NDK.

I’ve upgraded the project to use Gradle instead of Ant. Gradle downloads all of the SDK dependencies for you, so that should no longer be an issue. I’ve got it building on Ubuntu 16.04 (command line) and Windows 10 (Android Studio). The former will be useful for the build machine, the latter is really handy for debugging (even if Android Studio is rather slow).

I think the issue you were seeing was probably the “android” command being deprecated? If so and you still wanted to build the old project, you can downgrade the Android command line tools and it should work:

1 Like

Do we need to store all of the dependencies in Cataclysm repo? Can we pull it during building?

16 commits
5,896 files changed 

Showing 5,896 changed files with 2,359,133 additions and 13 deletions. 

https://github.com/CleverRaven/Cataclysm-DDA/compare/master...a1studmuffin:android-build-standup

We could, but the main complication is that there are some minor changes we’ve made to SDL required for the software renderer to work reliably. Without those changes, the software renderer breaks when locking the screen, switching app focus, or bringing down the quick settings menu. It also breaks when you rotate the screen, but we’ve dodged that one by locking the app to landscape.

To complicate matters, the hardware renderer fails on certain devices (Android 6.0 mostly) due to a driver issue. So it’s kinda important that there’s at least one working solution for each device.

All that said, I did add a prelaunch settings screen yesterday that allows the user to adjust software rendering (and tiles on/off for low memory devices) before attempting to load the game.

So I think it’s a call that needs to be made by someone other than me. If it were my repo I’d just throw everything in there so it compiles out of the box and allows us to attempt further fixes to SDL, but if the core devs would prefer a light repo and accept the broken software renderer, then that’s fine, but it will mean users on Android 6.0 (about 25% of the player base) can’t use the app without having to restart every time they lock the screen, switch app focus, or use the quick settings menu.

Omg thank you so much. Due to a christmas night house fire, android is the only way I can play this game. Ive only ever been able to use 0.c release on google play so Im so stoked this is being worked on! Now I just have to figure out how to get an apk of the newer version. Have no idea how to compile it and only have my tablet to do it on.

Download link for APK is in this post:

Oh duh. I guess I missed that apk. Thanks for pointint it out.

If you’re forking SDL, you need to fork SDL in another repo and take a dependency on it, not put it in the same repo.

Thanks Kevin, makes sense - I’ll sort that out before I send the PR.

Hi, I just downloaded the new APK after using the google play version for a month with no issues. The new version loads the big Z and then a blacl screen before crashing, every time. I still have the play store version installed as well if that’s going to mess anything up. I’m on a huawei p10 lite, and don’t have an SD.

Thanks for the report. Not sure what the issue is there tbh, that device should be plenty powerful enough. Next version will have a pre-game launch screen that allows setting use tiles + software renderer before the game actually starts up - that might get you further. There’s bound to be a tonne of device-specific issues like these though, so on my list is getting some kind of crash reporting in place, then it should be easier to narrow down what’s going wrong. That was one great thing about having the APK up on Google Play, the crash reports are very detailed.

1 Like

So it may be software rendering being annoying? The play store version works, would it be possible for me to move a config file with software rendering turned off from the play store version to the new one? Or would that be pointless?

Yeah that’s definitely worth a shot. If it doesn’t work with the other config file then it’s another issue, but very likely fixable once I can see the crash callstack. If you have adb installed (comes with the Android SDK), you can connect your device to your PC and run ‘adb logcat’ and capture the output while the game crashes, and send that to me by email (a1studmuffin@gmail.com). Otherwise just hang tight until I’ve got automatic crash reporting working.

1 Like