O'Reilly logo

Mastering Android Studio 3 by Kyle Mew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sensor emulation

If you have not used the Android emulators for some time or are new to them, you may well have missed the extended controls that each AVD has. These can be accessed from the bottom of the emulator's toolbar.

These extended controls offer a host of useful functions such as the ability to easily set mock locations and alternative input methods. Of interest to us here are virtual sensors. These allow us to simulate a variety of sensors and input values directly:

Virtual sensors

There are several other routes to running sensors on emulated devices. Most of these depend on connecting real devices and using their hardware. These ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required