android-sensors

command
v1.17.8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command android-sensors is a development example (step 31.7): a Material page that opens the accelerometer and the gyroscope through package sensors, shows their latest readings, and logs them twice a second. The device tests start it on the emulator, set the emulator's virtual sensors (adb emu sensor set), and check that the readings follow with the right values and axes; on a phone it is the manual check (tilt the phone and the numbers move, and the arrow of the page turns with it). In a browser on a phone (go run ./cmd/glutter-web serve ./examples/dev/android-sensors) it shows the same, and a tap or a long press vibrates the phone. It uses the public API only.

The log lines (the default logger's, so "INFO " comes first):

sensors open kind=<accelerometer|gyroscope> rate=<n>
sensors failed kind=<kind> err=<tag>
sensors accelerometer x=<n> y=<n> z=<n> readings=<n> frames=<n> dropped=<n>
sensors gyroscope x=<n> y=<n> z=<n> readings=<n> frames=<n> dropped=<n>

where readings is how many readings the listener was given and frames how many calls (batches) it took.

Jump to

Keyboard shortcuts

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