commit | eb942daed4270677b8fa3ff991ed91d77a5882ef | [log] [tgz] |
---|---|---|
author | Denis Bernard <db047h@gmail.com> | Fri Feb 27 16:13:55 2015 +0100 |
committer | Nigel Tao <nigeltao@golang.org> | Sun Mar 01 00:18:37 2015 +0000 |
tree | d7a0ed118c34ebdf833b797a39e13593542dd2f7 | |
parent | d26ae0184c85a94f702cb23f0cffd5def4a2ca8c [diff] |
mobile/app: need to create an XColormap in X11 implementation When the preferred visual returned by EGL is different from the parent window's visual, a private colormap is needed in the call to XCreateWindow. See X server source code http://cgit.freedesktop.org/xorg/xserver/tree/dix/window.c#n708 This patch systematically creates a TrueColor XColormap, regardless of the visual returned by eglGetConfigAttrib(). Fixes #9997 Change-Id: I3caf7c6d46991b1f0268e72197fca5186612b5da Reviewed-on: https://go-review.googlesource.com/6260 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org>
The Go mobile repository holds packages and build tools for using Go on Android.
This is early work and the build system is a bumpy ride. Building a binary for Android requires using a Go cross compiler and an external linker from the NDK.
For now, the easiest way to setup a build environment is using the provided Dockerfile:
docker pull golang/mobile
Get the sample applications.
go get -d golang.org/x/mobile/example/...
In your app directory under your $GOPATH
, copy the following files from either the golang.org/x/mobile/example/basic or golang.org/x/mobile/example/libhello apps:
AndroidManifest.xml all.bash build.xml jni/Android.mk make.bash
Start with basic
if you are writing an all-Go application (that is, an OpenGL game) or libhello if you are building a .so
file for use from Java via gobind. Edit the files to change the name of your app.
To build, run:
docker run -v $GOPATH/src:/src golang/mobile /bin/bash -c 'cd /src/your/project && ./make.bash'
Note the use of -v option to mount $GOPATH/src to /src of the container. The above command will fail if the -v option is missing or the specified volume is not accessible from the container.
When working with an all-Go application, this will produce a binary at $GOPATH/src/your/project/bin/name-debug.apk
. You can use the adb tool to install and run this app. See all.bash for an example.
APIs are currently very limited, but under active development. Package documentation serves as a starting point:
Contributions to Go are appreciated. See https://golang.org/doc/contribute.html.