[mirror] Go on Mobile https://golang.org/x/mobile
Go to file
Hyang-Ah (Hana) Kim bdbc727b12 bind/java: convert test.bash to go test.
This change deletes unnecessary files - they are auto-generated by
the gomobile bind command.

Change-Id: I490664dfcf52683dd8d2ea821d0b7e458bc06671
Reviewed-on: https://go-review.googlesource.com/8925
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-15 12:57:12 +00:00
app mobile/app: update the window width and height after rotation 2015-04-11 11:51:47 +00:00
audio audio: add notice about the OpenAL license 2015-04-13 22:34:15 +00:00
bind bind/java: convert test.bash to go test. 2015-04-15 12:57:12 +00:00
build build/androidtest.bash: script to run all tests in a repository on an 2014-12-18 00:48:16 +00:00
cmd cmd/gomobile: change the bind command to output .aar format for Android. 2015-03-30 20:00:37 +00:00
event mobile: add import comments. 2014-12-10 01:59:04 +00:00
example gl: use better spec-defined func names, fix bug, increase consistency 2015-03-25 21:38:11 +00:00
f32 mobile: add import comments. 2014-12-10 01:59:04 +00:00
font mobile: add extra build tags. 2015-01-20 15:15:48 +00:00
geom mobile: add import comments. 2014-12-10 01:59:04 +00:00
gl gl: Improve API signatures to match spec, improve docs. 2015-03-30 19:58:17 +00:00
sensor sensor: minimize the number of epolls 2015-04-08 03:40:08 +00:00
sprite sprite/glsprite: add very basic package docs 2014-12-12 14:44:04 +00:00
testdata example/sprite: make example lives 2014-12-22 13:10:48 +00:00
.gitattributes mobile: copying .gitattributes to all subrepositories 2014-12-23 23:23:25 +00:00
.gitignore convert .hgignore to .gitignore. 2014-12-08 10:43:03 +11:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
CONTRIBUTING.md doc: add CONTRIBUTING.md 2015-02-18 23:42:31 +00:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
Dockerfile mobile: add go 1.4 for bootstrap & pin the revision of Go. 2015-01-23 16:07:06 +00:00
LICENSE LICENSE: add 2012-03-17 15:20:58 +11:00
PATENTS go.empty: add PATENTS file to the subrepo. 2012-04-16 11:24:04 +10:00
README.md mobile: list the sensor package on README 2015-04-02 22:12:29 +00:00
codereview.cfg mobile: add codereview.cfg 2015-03-18 17:03:44 +00:00

README.md

Go support for Mobile devices

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.