gospeedtest

command module
v0.0.0-...-911bacd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2015 License: MIT Imports: 11 Imported by: 0

README

Go Speedtest

Simple internet speedtest written in Go for Android

Installation

  1. Download go1.5beta2 here

  2. 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
Code usage

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()

http://www.sajalkayan.com/post/android-apps-golang.html

Documentation

Overview

An app that displays the current interent speed for the device.

Note: This demo is an early preview of Go 1.5. In order to build this program as an Android APK using the gomobile tool.

See http://godoc.org/golang.org/x/mobile/cmd/gomobile to install gomobile.

Get the basic example and use gomobile to build or install it on your device.

$ go get -d github.com/dr4ke616/gospeedtest
$ cd github.com/dr4ke616/gospeedtest
$ gomobile build . # will build an APK

# plug your Android device to your computer or start an Android emulator.
# if you have adb installed on your machine, use gomobile install to
# build and deploy the APK to an Android target.
$ gomobile install golang.org/x/mobile/example/basic

Switch to your device or emulator to start the Basic application from the launcher. You can also run the application on your desktop by running the command below. (Note: It currently doesn't work on Windows.)

$ go install golang.org/x/mobile/example/basic && basic

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL