Go 1.4 support for Android instructions (translated)

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.


Https://docs.google.com/document/d/1N3XyVkAP8nmWjASz8L_OjjnjVKxgeVBjIsTr5qIUcA4/edit?pli=1

Summary

We plan to introduce go support for the Android platform. We will focus on supporting the development of games with go.

Background

Android is an operating system designed to run the app. An app relies on more platform libraries and services (than a traditional UNIX operating system), which means it won't be much use without a port on the Go runtime on the new api,android.

Providing an Android platform equivalent to go is hard to avoid. The platform is written in Java and has a lot of API interfaces. Any attempt to encapsulate these APIs with go will get a bad result: manually compiling the package will not keep up with the feature, and automatically generating the package will lead to ugly go. Either way, it will be slow.

However, the Android NDK offers a subset of Android apps written with very few C-based APIs: Games. It is possible to compile go for Android to provide the equivalent features of the NDK.

Suggestions

During the go 1.4 cycle, goos=android will be introduced to the Go repository, along with Android support CGO. Dalvik/art-loadable. So files are generated using the external Android NDK linker.

For the compilation panel, we will maintain a cross-compiler to run the Go tool on the Linux host and use the ADB tool to run the test binaries on the Android emulator.

We will introduce sub-warehouses, Go.mobile, which include:

    • Binding OpenGL OPENSL and OpenMAX

    • The Java->go binder. Given a go package, this will allow Java code to invoke it so that the game menu UI can be compiled with the standard SDK. (because go defines bindings, which makes it possible to use the same code to bind like the Objective C language)

    • Android Studio Compilation system integration

Binary packages are released after the project is stable.


Attached Original:

go support for androiddavid crawshawjune 2014abstractwe propose to  Introduce go support for the android platform. the focus will  be on supportinggames written in Go. The APIs will be  Those defined in the android ndk. Backgroundandroid is an operating system designed for running apps.  An app relies on far more platformlibraries and services  Than are provided by a traditional unix operating system, which  means adirect port of the go runtime to android without  new apis would not be particularly useful. Providing a go equivalent to the android platform is intractable. &nBsp The platform is written in javaand has a huge api surface.  any attempt to wrap these apis in go would give an  undesirableresult: manually built wrappers would lag in features,  automatically generated wrappers wouldlead to ugly Go. And  Either way, it would be slow. There is however, a subset of android apps written against a  MUCH SMALLER C-BASED APISURFACE PROVIDED IN THE ANDROID NDK:  Games. It is feasible to build Go support for  Androidproviding the equivalent features found in the ndk. proposalduring the go 1.4 cycle, goos=android will be introduced  To the go repository, along with cgosupport on android  ( Contributed by elias naur).  dalvik/art-loadable .so files will be  producedusing the external linker provided in the android ndk. for the build dashboard, we will maintain a cross-compiling  builder that runs the go tool on alinux host and uses  the adb tool to run test binaries on a stock android  Device. We will introduce a subrepository, go.mobile. it will house:   Bindings for opengl, opensl, and openmax as exported through the  android ndk.  A Java -> Go language binding generator.  Given a go package,  this will let java codecall it, so game menu uis can  be built in the standard SDK.  (as go defines the  Binding, italso makes it possible to use the same code to  bind to languages like objective c.)  android studio build system integration. Binary releases will be provided after the project has stabilized .


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.