Go Java Objective-C C Groovy HTML Other
Latest commit c243211 Jan 17, 2017 @eliasnaur eliasnaur bind,internal/importers: add Unwrap methods to unwrap Java wrappers
For Java classes implemented in Go, it is useful to take a Java instance
and extract its wrapped Go instance. For example, consider the
java.lang.Runnable implementation wrapping a Go function:

package somepkg

type GoRunnable struct {
    lang.Runnable
    f func()
}

Java methods that take a java.lang.Runnable cannot directly take a
*GoRunnable, so this CL adds a Unwrap method:

import gorun "Java/somepkg/GoRunnable"

...

r := gorun.New()
r.Unwrap().(*GoRunnable).f = func() { ... }
javapkg.Run(r)

The extra interface conversion is unfortunately needed to avoid
import cycles.

Change-Id: Ib775a5712cd25aa75a19d364a55d76b1e11dce77
Reviewed-on: https://go-review.googlesource.com/35295
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Permalink
Failed to load latest commit information.
app event/size: document size pt approximation Aug 4, 2016
asset asset,exp/audio/al: cast context to jobject Jan 11, 2016
bind bind,internal/importers: add Unwrap methods to unwrap Java wrappers Jan 18, 2017
cmd bind,internal/importers: add Unwrap methods to unwrap Java wrappers Jan 18, 2017
doc README.md: add caution. shorten the README.md. Jul 17, 2015
event event/size: document size pt approximation Aug 4, 2016
example cmd/gomobile: avoid header guard clash in iOS headers Jan 18, 2017
exp exp/audio/al: use the correct native library dir to locate libopenal.so Jan 13, 2017
geom app: use one thread for both GL and other UI C code. Jun 26, 2015
gl x/mobile/gl: fix building on windows/386 Oct 26, 2016
internal bind,internal/importers: add Unwrap methods to unwrap Java wrappers Jan 18, 2017
misc/androidstudio misc/androidstudio: fix the classpath for gobind and gomobile Jan 17, 2017
testdata example/sprite: make example lives Dec 22, 2014
.gitattributes mobile: copying .gitattributes to all subrepositories Dec 23, 2014
.gitignore .gitignore: remove *.xcodeproj Sep 3, 2015
AUTHORS go.empty: prototype for new subrepository Jan 25, 2012
CONTRIBUTING.md doc: add CONTRIBUTING.md Feb 18, 2015
CONTRIBUTORS go.empty: prototype for new subrepository Jan 25, 2012
LICENSE LICENSE: add Mar 17, 2012
PATENTS go.empty: add PATENTS file to the subrepo. Apr 16, 2012
README.md docs: provide a template for the new issues Oct 6, 2015
codereview.cfg mobile: add codereview.cfg Mar 18, 2015

README.md

Go support for Mobile devices

The Go mobile repository holds packages and build tools for using Go on mobile platforms.

Package documentation as a starting point:

Caution image

The Go Mobile project is experimental. Use this at your own risk. While we are working hard to improve it, neither Google nor the Go team can provide end-user support.

This is early work and installing the build system requires Go 1.5. Follow the instructions on golang.org/wiki/Mobile to install the gomobile command, build the basic and the bind example apps.

Contributions to Go are appreciated. See https://golang.org/doc/contribute.html.