Hello Google Maps

Post on 10-Feb-2016

53 views 0 download

Tags:

description

Hello Google Maps. Google Map View. Before Programming. Install Google Maps library installed in your SDK environment After install Set your project properties to use the build target called "Google APIs by Google Inc .“ Obtaining a Maps API Key. Google Maps library . Property Setting. - PowerPoint PPT Presentation

transcript

Hello Google MapsGoogle Map View

Install◦ Google Maps library installed in your SDK

environment After install

◦ Set your project properties to use the build target called "Google APIs by Google Inc.“

Obtaining a Maps API Key

Before Programming

Google Maps library 

Property Setting

Obtaining a Maps API Key http://code.google.com/android/add-ons/goo

gle-apis/mapkey.html

Programming

Step 1: Start a new project named HelloGoogleMaps.

Step 2: Declare Maps library in the Android Manifest

Must request internet permission. In the manifest file, add the following as a child of the <manifest> element:

Step 3: Access to the Internet

Step 4:Give the map some more space getting rid of the title bar with the

"NoTitleBar" theme

Step 5: Set MapView layout

Step 6: CodingUsing MapActivity

This method is required for some accounting from the Maps service to see if you're currently displaying any route information. In this case, you're not, so return false.

Simple zoom feature is built-in

Remember, you must have an AVD configured to use the Google APIs target, or be using a development device that includes the Maps library.)

Step 7: Run it