Chapter 33 Locations and Play Services
MockWalker will trigger a mock walk for you via a service that posts mock location data to Fused
Location Provider. It will pretend to walk in a loop around the Kirkwood neighborhood in Atlanta.
While the service is running, any time Locatr asks Fused Location Provider for a location fix, it will
receive a location posted by MockWalker.
Run MockWalker and press Start (Figure 33.6). Its service will keep running after you exit the app.
(Do not exit the emulator, however. Leave the emulator running while you work on Locatr.) When you
no longer need those mock locations, open MockWalker again and press the Stop button.
Figure 33.6 Running MockWalker
If you would like to know how MockWalker works, you can find its source code in the solutions folder
for this chapter (see the section called Adding an Icon in Chapter 2 for more on the solutions). It uses a
few interesting things: RxJava and a sticky foreground service to manage the ongoing location updates.
If those sound interesting to you, check it out.