Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Show Me the Map!

Determining your user’s location is one thing, but actually putting those two indecipherable numbers (longitude and latitude) into context is where software gets a little more complex. Interestingly enough, the configuration needed to get a map onscreen is far more complex than the code to manipulate it. So, let’s get started. If you want to follow along, go ahead and create a new Android project, and we’ll start from there.

Getting the Library

The MapActivity and MapView are two classes available only in Google’s API superset (APIs) of the Android SDK. In order to have access to them, you’ll need to declare that your application uses the Google APIs library. You’ll need to download this super-library (the same way you got the Ice Cream Sandwich and Gingerbread SDKs back in Chapter 1). Figure 9.1 shows what the settings screen for your project should look like if you’ve got it dialed in correctly.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial