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 ~ ~ ~