O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

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

Testing Locations on Real and Virtual Devices

Testing an app like RunTracker can be challenging, even for an avid outdoors-programmer. You want to ensure that the locations you receive from the system are being appropriately tracked and stored. This can be difficult to do if you are moving around, even at the low speeds achieved by having your friend haul you and your development setup around the neighborhood on a bicycle trailer.

To get around situations like this, you can send test locations to the LocationManager that will allow your device to pretend that it is somewhere else.

The simplest way to make this happen is using the Emulator Control window within DDMS. This only works with virtual devices, but it allows you to specify new locations ...

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