4 ms·
Can you build Android UI using Go? I have not found a good UI library in Go.
by hanief 12y ago
Can you build Android UI using Go? I have not found a good UI library in Go.
- kev6168 12y agoAlso can someone please give a brief description of whole process to write a simple Android app in Go? What are the bare bone setup(Go, JDK, Android SDK??, etc.), so I can develop and compile? Is the final result an apk file? Thanks.
- faitswulff 12y agoI'm not an Android developer, but have you seen the examples yet? https://github.com/golang/mobile/tree/master/example https://github.com/golang/mobile/tree/master/example
- kev6168 12y agoI am also not an Android developer, so don't know how to get started using Go for Android. Do I need to set up a Java skeleton first so it can call my Go code? Use Android Studio or other IDE? libraries needed? You know the basic set up and steps for producing a 'Hello World' app. If the instruction is already out there somewhere, I will be very glad to check it out. Golang for Android app, this is exciting.
- tjohns 12y agoYou can access OpenGL, but the full Android framework isn't directly exposed. It's similar to developing in C++ using the Android NDK. From the documentation (https://godoc.org/golang.org/x/mobile/app https://godoc.org/golang.org/x/mobile/app): An app can be written entirely in Go. This results in a significantly simpler programming environment (and eventually, portability to iOS), however only a very restricted set of Android APIs are available. The provided interfaces are focused on games. It is expected that the app will draw to the entire screen (via OpenGL, see the go.mobile/gl package), and that none of the platform's screen management infrastructure is exposed. On Android, this means a native app is equivalent to a single Activity (in particular a NativeActivity) and on iOS, a single UIWindow. Touch events will be accessible via this package. When Android support is out of preview, all APIs supported by the Android NDK will be exposed via a Go package. Alternatively, you could write your UI code in Java and call into a Go shared library via JNI methods, if you aren't worried about graphics and just need code portability. Again, this is similar to working in the NDK.
- hanief 12y agoThanks for the link. I just read about it. So probably it's not a substitute for Java (yet) right? I guess it's kind of a replacement of C++ for multi-platform games development.