gomobile

Access geolocation data using gomobile

那年仲夏 提交于 2021-02-08 09:28:44
问题 Can I access the phone's geolocation using a native gomobile application? I have seen experimental support for sensor data here, but nothing about the actual latitude, longitude of the device. I have no prior experience in app development, and I am learning Go at the moment. 回答1: AFAIK there is no ready solution yet to access location on both Android and iOS in a platform independent way. But in theory you could make separate packages using the gomobile tool to generate bindings for each

Golang: Gomobile app cannot generate files

跟風遠走 提交于 2020-02-06 05:47:09
问题 Does anyone use gomobile app before and have successfully create files in phones? I tried the following code on Galaxy S4 with Android 4.4.2: package main import ( "golang.org/x/mobile/app" "golang.org/x/mobile/event/lifecycle" "golang.org/x/mobile/event/paint" "os" ) func main() { os.Create("zzz.txt") app.Main(func(a app.App) { for e := range a.Events() { switch e := a.Filter(e).(type) { case lifecycle.Event: _=e case paint.Event: a.Publish() } } }) } However no file is created in the phone.