Mapping on Android

As enjoyable as it is to have data that tells you where your phone is, that data begs to be represented visually. Mapping was probably the first truly killer app for smartphones, which is why Android has had mapping since day one.

Mapping is big, complicated, and involves an entire support system of servers to provide base map data. Most of Android can stand alone as part of the Android Open Source Project. Maps, however, cannot.

So while Android has always had maps, maps have also always been separate from the rest of Android’s APIs. The current version of the Maps API, version 2, lives in Google Play Services along with the Fused Location Provider. So to use it, the same requirements apply as the ones you saw in the section called Google Play Services in Chapter 33: You have to either have a device with the Play Store installed or an emulator with the Google APIs.

If you are making something with maps and happen to flip straight to this chapter, make sure that you have followed the steps from the previous chapter before you start:

  • ensure that your device supports Play Services

  • import the appropriate Play Services library

  • use GoogleApiAvailability at an appropriate entry point to ensure that an up-to-date Play Store app is installed

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.190.101