Game Development Community

Android Studio support inbound

by Casey Doran · in Torque 2D Professional · 06/21/2015 (11:31 pm) · 3 replies

Figured I should post a thread so the community could take a look before I drop such a big PR out of nowhere.

Android studio 1.3 beta was released a little while ago, and it brought NDK support based on JetBrain's awesome CLion product.

I've started work on adding support for Android Studio alongside ADT, the existing Android compiler project.

This is not a straight import, I also added a copy step and a clean step to the build scripts that moves things in the project folder to a separate assets folder so that you don't have to copy that manually anymore for apk builds. It's a bit hacky, but from a clean checkout, it only copies the stuff you need to run the app, like main.cs and all the stuff in modules/.

I also changed the main application to use immersive sticky mode, which hides the navigation and notification bars unless you swipe in from an edge. This had the unfortunate side effect of bumping our minimum api level to 14. While that's a scary bump, as written the application will run on 94% of active Android devices. And, if a team wants to extend back to API level 8, they can simply use the older ADT project.

It builds and runs for me without much difficulty, but there's a lot of android configurations out there, so if you have a few minutes, I would appreciate it if you would download my branch and try building it. Make sure you have a build of Android Studio >=1.3. If yours is below, it might be that you're in the stable channel, you can change to the beta channel from the update dialogue.

github.com/elementc/Torque2D/tree/android-studio

Known issues right now:
  • The canvas doesn't expand to take up the space left behind by the navigation buttons (home, back, recents). This is my task for the week, I suspect it's a change in PlatformAndroid.
  • Crashes on some Android emulators due to a link error. This is to do with the currently shipping version of openal and x86, I'll look into it but I'm not expecting much.
  • Crashes semi-randomly when switching to/from the application. Hard to track down, and might already exist in the application. I intend to build with the old ADT this week and see if it's as crashy as this one is.

If you spot any bugs, please post them here or post an issue on my github fork. This is kind of a summer project for me, so I'll do my best to look, but no promises on timeliness.

About the author

Software Engineering researcher at the Florida Institute of Technology's Harris Institute for Assured Information, Intelligent Communication and Information Systems Laboratory


#1
06/21/2015 (11:35 pm)
While I'm talking about platform support, I've posted a new PR, #246, based on @3dDeters' PR #239, which looks like it was closed on a technicality and not reopened correctly. Fixes the rotation bug in iOS8. If someone could take a look at it, that would be lovely.
#2
06/24/2015 (2:28 pm)
Glad to see someone still working with T2D! Keep up the good work.
#3
11/21/2015 (12:21 am)
Very nice!