Chapter 33 Locations and Play Services
Run Locatr and press on the menu item again. This time, you will see the system permissions dialog
pop up (Figure 33.9).
Figure 33.9 The LOCATION permission group dialog
If you press ALLOW, then the permission will be granted until the user uninstalls the app or turns the
permission off. If you press DENY, then it will be denied for the moment – the next time you press
the button, the dialog will be shown again. (For debugging, we prefer to clear the permissions state by
uninstalling. Uninstalling apps is much more fun to do on Android than turning permissions off, so that
is how we do it.)
With that done, you can verify that the location behavior works as you expect. Remember to have
MockWalker running if you are using an emulator. (If you have problems with the menu, flip back to
Chapter 13 to integrate the AppCompat library.) Press the location button and accept the permission,
and you should see a line something like this logged out:
...D/libEGL: loaded /system/lib/egl/libGLESv2_MRVL.so
...D/GC: <tid=12423> OES20 ===> GC Version : GC Ver rls_pxa988_KK44_GC13.24
...D/OpenGLRenderer: Enabling debug mode 0
...I/LocatrFragment: Got a fix: Location[fused 33.758998,-84.331796 acc=38 et=...]