mobile/sensor: remove the unnecessary init mutex

Manager ops are not promised to be thread-safe.

Change-Id: Ib28b80d758234a7a19287c457c57099e36d73f9b
Reviewed-on: https://go-review.googlesource.com/8248
Reviewed-by: David Crawshaw <crawshaw@golang.org>
1 file changed
tree: 4a958b703959f2bb42e3f32e96ea6aa38f11cfb5
  1. app/
  2. audio/
  3. bind/
  4. build/
  5. cmd/
  6. event/
  7. example/
  8. f32/
  9. font/
  10. geom/
  11. gl/
  12. sensor/
  13. sprite/
  14. testdata/
  15. .gitattributes
  16. .gitignore
  17. AUTHORS
  18. codereview.cfg
  19. CONTRIBUTING.md
  20. CONTRIBUTORS
  21. Dockerfile
  22. LICENSE
  23. PATENTS
  24. README.md
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.