Simple internet speedtest written in Go for Android
-
Download go1.5beta2 here
-
Install Gomobile using go1.5beta2. This is a temp install of GoBeta, didnt want to mess up my current env
$ export PATH=/home/adam/Downloads/gobeta/bin/:$PATH
$ export PATH=/home/adam/Downloads/gobeta/temp_path/bin/:$PATH
$ export GOPATH=/home/adam/Downloads/gobeta/temp_path/
$ export GOROOT=/home/adam/Downloads/gobeta/
$ go get golang.org/x/mobile/cmd/gomobile
Build my speedtest app and create an APK
$ go get -d github.com/dr4ke616/gospeedtest
$ cd github.com/dr4ke616/gospeedtest
$ gomobile build . # will build an APK
To use gospeedtest as a library:
import (
...
"github.com/dr4ke616/gospeedtest/nw_speedtest"
)
st := nw_speedtest.Speedtest{
FileLocation: "http://download.thinkbroadband.com/10MB.zip",
Verbos: true,
}
result, err := st.Start()