Every six months or so another way to run go code on android devices is published. Sometimes it's SDK wrappers, other times (like this) it's native executables.<p>The author's approach is interesting, but lacks MIPS support (though would extend successfully to x86 devices, as the author notes).<p>My almost equivalent attempt was to rebuild the Android NDK (native development kit) toolchain with --language=go added, and built all the GCC/GNU toolchain support for it for <i>all</i> targets. (Granted the rebuild-the-toolchain solution can be a bit hairy if you're not familiar with it.)
This is nothing more than a pure hack as it is not supported by Google and does not allow distribution via Play Store.<p>The ticket for Go support is open since 2012, so clearly there isn't any interest from Android team to do so.<p><a href="https://code.google.com/p/android/issues/detail?id=39482" rel="nofollow">https://code.google.com/p/android/issues/detail?id=39482</a>
I'm not sure why Google hasn't adopted Go as another supported language to develop on Android. It seems naturally and would expand the usage of the language.
Using the NDK is already such a pain in the ass (we are using pjsip in some of our apps) that I couldn't imagine why I would want to switch from C to Go, which isn't even officially supported.<p>And you have to consider that soon everyone will switch to the Gradle build system, which adds amazing possibilities, but also adds a lot of complexity with build types and product flavors on top of the existing complexity with the NDK.
This is awesome, one of those posts that reminds me why I read HN so much.<p>I'm an Android developer (they exist!) and I'll definitely try this out in my next app, just for fun. Anyone have any ideas for something I could do with this that I can't do, or do easily anyway, with a regular Java Android app?
Is there a way to build your Go stuff as a real, embeddable library and then call into it from C (via the NDK)?<p>I think this would be a more natural way of doing it, and also be potentially more reusable on other platforms like iOS (which forbid launching processes).<p>I would be interested in writing a simple HTTP server for my app in Go, and be able to invoke it (start, stop, etc) through a simple C-API. Then I could write the rest of the GUI in the native platform language (Java for Android, Objective-C for iOS).