Go Support for Android

Source: Internet
Author: User
Tags wrappers

Go Support for Android

David Crawshaw

June 2014

Abstract

We propose to introduce Go support for the Android platform. The focus is being on supporting games written in Go. The APIs would be those defined in the Android NDK.

Background

Android is a operating system designed for running apps. An app relies on far more platform libraries and services than is provided by a traditional Unix operating system, which means a direct 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. The platform are written in Java and have a huge API surface. Any attempt to wrap these APIs in Go would give a undesirable result:manually built wrappers would lag in features, auto Matically generated wrappers would leads to ugly Go. and either, it would be slow.

There is however, a subset of Android apps written against a much smaller c-based API surface provided in the Android NDK: Games. It's feasible to build Go support for Android providing the equivalent features found in the NDK.

Proposal

During The Go 1.4 cycle, goos=android'll be a introduced to the Go repository, along with Cgo in Android (Contribu Ted by Elias Naur). Dalvik-loadable. So files would be produced using the external linker provided in the Android NDK.

For the build dashboard, we'll maintain a cross-compiling builder that runs the Go tool on a Linux host and uses the ADB Tool to run test binaries on a stock Android device.

We'll introduce a subrepository, Go.mobile. It would house:

    • Bindings for OpenGL, OpenSL, and OpenMAX as exported through the Android NDK.

    • A Java, Go language binding generator. Given a Go package, this would let Java code call it, so game menu UIs can is built in the standard SDK. (as Go defines the binding, it also makes it possible to use the same code to bind to languages like Objective C.)

    • Android Studio build system integration.

Binary releases is provided after the project has stabilized.

Go Support for Android

Related Article

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.