You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. I tried to specify a path but doesn't help.
I also tried an app called "AnGoIde" which allow us to write Go and compile directly in Android, and the following code is able to create the "zzz.txt" file:
package main
import "os"
func main(){
os.Create("zzz.txt")
}
The text was updated successfully, but these errors were encountered:
Please remove my comment if it should not appear in a bug report, but I have no idea what error os.Create is having since I don't know how to see the errors from phones, so I would like to write errors to a file with os.Create . Do you know any way I can see the errors without write to a file? thx..
Just printing to stderr (e.g. use println builtin), I think Android
application's
stderr is connected to device log so you should be able to view with
adb logcat.
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. I tried to specify a path but doesn't help.
I also tried an app called "AnGoIde" which allow us to write Go and compile directly in Android, and the following code is able to create the "zzz.txt" file:
package main
import "os"
func main(){
os.Create("zzz.txt")
}
The text was updated successfully, but these errors were encountered: