This is a creation in Article, where the information may have evolved or changed.
The Go language will support development for Android platform in version 1.4
When Apple released the Swift language, I felt that Google would probably let its go language support the Android system. Sure enough, Apple's swift language makes Google feel pressured. So the gospel for all Golang developers is coming.
David Crawshaw
June 2014
Summary
We propose to introduce the go language into the Android platform. Emphasis will support the use of the go language to write games. These APIs will be defined in the ANDROIDNDK.
Background
Android is an operating system for running applications (apps). Rather than just providing a traditional UNIX operating system, the application relies more on the platform libraries and services provided. This means that there is no new APIs, and direct access to the Go runtime for Android will not be particularly useful.
How to introduce go is a tricky thing to do. Because the Android platform is written in Java and has a large number of APIs. Any attempt to use go to package these APIs will not get the desired results. Manually building the wrapper will lag behind in terms of features, and automatically generating wrappers will result in ugly go codes. Either way, this can cause the program to run slowly.
However, a subset of Android apps: games, using ANDROIDNDK to provide a smaller C language based API on the surface. It is possible for the go support Android to provide the same features as the NDK.
Suggestions
In Go 1.4, the Android platform was compiled into the go code base, and included Android-enabled CGO (contributed by Elias Naur). Dalvik/art-loadable. So files will be generated using the external link file of the Android NDK.
On the release, we still provide a cross-compilation platform and support for testing programs on Android devices using ADB tools on Linux hosts.
We will provide a sub-version called Go.mobile, which includes:
- Support for OpenGL, OpenSL, and OpenMAX via the Android NDK;
- A Java->go language binding generator. The go package can be called through Java code, so the game menu UIs can be built using the standard SDK (it is possible to support calling go in other languages, such as Objective-c).
System integration
- Android Studio
The new feature will be available after the go version is stable.
My translation level is limited, if there are errors, please forgive me.
Watching the go language is getting more and more power, is not very want to learn. Then follow the code to learn Golang language.
Welcome to pay attention to code surgery! Learn Golang together.