[Original] unscientific go language development Android Configuration tutorial

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

Go language is good, so as an Android development of course to seize this opportunity ah, to a android-go development tutorial bar ~ ~

Degree Niang very not to force, find a lot of is need science online go get golang.org/x/mobile, and a lot of can not install Qaq, recently also can't buy VPN, can only find a way ...

But fortunately, the charm of open source is here, and sure enough there is the official Git library, there is the code can be ~
No nonsense, eat a peach to dry ~ ~

Environment: Centos 7, Golang 1.7.4, operating system does not matter all the same ~ ~

STEP 0: Install the go locale, git environment, this part skip it ...

STEP 1: Download the source code and copy it to Gopath

git clone https://github.com/golang/mobile.git

After a long wait clone down to copy into the Gopath inside (cut also can, anyway the body also didn't use)

But pay attention to the path

Mkdir-p $GOPATH/src/golang.org/x

Cp-r Mobile $GOPATH/src/golang/x/

STEP 2: Compile & Install Gomobile

CD $GOPATH/src/golang.org/x/mobile/cmd/gomobile

Go Build

Go Install

Okay, no problem, you can run Gomobile now.

And then

Gomobile init-v

Install the following required libraries such as NDK what

Terminal inside input

Gomobile version

See the version number is successful, now Gomobile installation success

STEP 3: Try to compile the sample program and run

First, connect your phone to your computer. ADB devices display Normal

And then

Gomobile build-target=android Golang.org/x/mobile/example/basic

Build the APK package inside this path

Installation

Gomobile Install Golang.org/x/mobile/example/basic

and normal ADB installation is no different ...

PS: The actual combination of as development is not so troublesome ....

Okay, I'm done.


Follow-up will bring the go to develop Android Tutorial Oh ~ ~ ~

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.