The go language can already write Android projects, you know?

Source: Internet
Author: User
Tags install go
This is a creation in Article, where the information may have evolved or changed.

The new library is named Go.mobile, which contains the tools for the go for Android library

In the Go.mobile Library's readme, there is an introduction to the development environment, but only in the earlier version, the integration into the IDE's build system has not yet.

    1. First you need the Android SDK, and the NDK.
    2. Then you need to add an environment variable: ndk_root= $HOME/android/ndk-toolchain
    3. Configure NDK Tools ndk/build/tools/make-standalone-toolchain.sh-platform=android-9--install-dir= $NDK _root
    4. Install Go Cross-compiler
      1. HG Clone Https://code.google.com/p/go
      2. CD GO/SRC
      3. cc_for_target= $NDK _cc goos=android goarch=arm goarm=7./make.bash
    5. If you have previously installed go, it is the for PC platform by default, so build arm here. That's probably the point.
    6. Add Go/bin to the PATH environment variable
With go, you can develop two kinds of projects, one is Android Java code call to go, the other is pure go write app, the second is to provide open GL and complete Golang development environment.


Apps is written in Java, developed using the standard Android
Tools, which include a Go library for added functionality. There is an
Example of such a library in Go.mobile/example/libhello.


To build the shared library with the Make.bash script in the example ' s
Directory. IT requires an environment variable, Android_app, set to the
Location of your Android studio project. e.g.


android_app= $HOME/android/studio/yourapp/app


With this variable, Make.bash builds the. A file and symlinks in the
Necessary Java files to the project.




Go Android Apps (games)
-------------


Go Android Apps is built on top of the NDK ' s nativeactivity. These apps
is written entirely in Go. An example of such a app, with touch events
And OpenGL, is in Go.mobile/example/basic.


To build and deploy the app to the device currently attached to ADB,
Use the All.bash script in the example ' s directory. It requires
Ndk-build, Ant, and adb on your PATH.


APIs is currently very limited, but under active development.


To submit changes to this repository, see http://golang.org/doc/contribute.html.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.