In the original proposal for Go Android support,
http://golang.org/s/go14android, I decided to avoid generating Go
interfaces for the Android SDK for two reasons. The first is that I
don't think I can build idiomatic Go packages that present all of the
features in the SDK. (It will end up looking like Java.) The second
reason is we are interested in platform portability, and there are too
many non-overlapping features in mobile device APIs to create a common
set of libraries.
I suppose now I can add a third reason, which is just the simple
foundational work in x/mobile has turned out to be very involved. Good
support for iOS for what little is there is going to take a lot of
work. I'm not sure we have the hours to properly maintain anything
more.
That said, I think your project is very interesting and I hope you
keep working on it. One thing I noticed on a quick look through your
code: you may not realize that gobind will manage callbacks from Java
into Go. That is if your Go package defines:
type Callback interface {
CallJava(x T) U
}
func Register(c Callback) {
c.CallJava(x) // c can be stored for later use
}
Then in Java you can subclass the generated class and implement the
CallJava method:
public class J extends gopkg.Callback {
public CallJava(T x) U {
// code you want called from Go.
}
}
...
gopkg.Register(new J());
This may save you some of the bookkeeping you are doing in your android package.
Thank you for sharing your work.
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-nuts...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.