mirror of
https://github.com/go-i2p/gomobile-java.git
synced 2025-07-13 20:41:37 -04:00

We are also limiting the number of sensor managers to one. The application provide sensor events to third-party packages by consuming them in the main. An application will be able to consume the sensor events similar to the other events. package main func main() { app.Main(func(a app.App) { // enables the accelerometer sensor.Enable(a, sensor.Accelerometer, 100*time.Millisecond) var sz size.Event for e := range a.Events() { switch e := app.Filter(e).(type) { case sensor.Event: log.Println(e) } } }) } Change-Id: Iaad1c59f8d2322c7620df62ed9b9283c91746fa8 Reviewed-on: https://go-review.googlesource.com/13983 Reviewed-by: Nigel Tao <nigeltao@golang.org>
golang.org/x/mobile/exp contains experimental packages for mobile app development.