Golang for Android

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

Go is a simple and efficient language, the Go 1.4 version supports running on Android

Go get golang.org/x/mobile

Go get golang.org/x/mobile/example

Run the sample code with the path $gopath/src/Golang.org/x/mobile/example/libhello

Run All.bash compile and package the installation

If error:

Go build runtime:android/arm must be bootstrapped using Make.bash

It means that you do not compile the arm version of Go and need to go to $goroot/src to compile the android/arm version

#拣出一套交叉编译工具 $NDK _root/build/tools/make-standalone-toolchain.sh--platform=android-9--install-dir= $NDK _tool# Compile Android/arm support package sudo cc_for_target= $NDK _tool/ndk-toolchain/arm-linux-androideabi/bin/gcc cgo_enabled=1 GOOS= Android Goarch=arm goarm=7./make.bash

And then go back to the sample code to execute All.bash to successfully compile the APK

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.