Add stub android implementation.

This commit is contained in:
Greg 2019-10-28 12:46:57 -04:00
parent 5e2898f553
commit c9f3733aee
6 changed files with 25 additions and 3 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
hrm
*.apk

2
go.mod
View File

@ -4,6 +4,6 @@ go 1.13
require (
gioui.org v0.0.0-20191028123051-439d3e652c8f
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f
gopkg.in/yaml.v2 v2.2.4
)

2
go.sum
View File

@ -11,6 +11,8 @@ git.wow.st/gmp/ble v0.0.0-20191028132523-2d4f106dd76c h1:GUCh9nytD5hEqw8B5/vXtY8
git.wow.st/gmp/ble v0.0.0-20191028132523-2d4f106dd76c/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc h1:wh2wjBt1/b+pH9PPP2TJZzv8HjpwsN0t+rN6dRwAfvY=
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f h1:QcNTjwSAe+/+2jdeeKx3EjS3CPv4Ur8AVrVlFfMquck=
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

View File

@ -31,7 +31,7 @@ var Config conf
var conffile string
func main() {
conffile = path.Join(confDir, "config.yml")
conffile = path.Join(getConfDir(), "config.yml")
if _, err := os.Stat(conffile); os.IsNotExist(err) {
fd, err := os.Create(conffile)
if err != nil {

15
os_android.go Normal file
View File

@ -0,0 +1,15 @@
package main
import (
"gioui.org/app"
)
var confDir string
func getConfDir() string {
if confDir != "" {
return confDir
}
confDir,_ = app.DataDir()
return confDir
}

View File

@ -9,7 +9,10 @@ import (
var confDir string
func init() {
func getConfDir() string {
if confDir != "" {
return confDir
}
usr, err := user.Current()
if err != nil {
log.Fatal("Cannot get current user: ", err)
@ -23,4 +26,5 @@ func init() {
log.Print("Configuration directory created")
}
}
return confDir
}