![](https://csdnimg.cn/release/download_crawler_static/37236559/bg4.jpg)
3
We'll cover that mysterious apiKey later in this chapter, in the "The Key to It All"
section. In addition, you will need a couple of extra things in your
AndroidManifest.xml file:
The INTERNET and ACCESS_COARSE_LOCATION permissions (the
latter for use with the MyLocationOverlay class, described later in this
chapter)
Inside your <application>, a <uses-library> element with
android:name ="com.google.android.maps", to indicate you are using one of
the optional Android APIs
Here is the AndroidManifest.xml file for NooYawk:
<?xml version= ”1.0 ” encoding= ”utf-8”?>
<manifest xmlns:android= ”http://schemas.android.com/apk/res/android ”
package="com.commonsware.android.maps ”>
<uses-permission android:name= ”android. permission.INTERNET ” />
<uses-permission
android:name= ”android.permission.ACCESS_COARES_LOCATION” />
<application android:label="@string/app_name"
android:icon="@drawable/cw">
<uses-library android:name= ”com.google.android.maps"/>
<activity android:name=".NooYawk ” android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
That is pretty much all you need for starters, plus to subclass your activity from
MapActivity. If you were to do nothing else, and built that project and tossed it in the
emulator, you would get a nice map of the world. Note, however, that MapActivity is
abstract. You need to implement isRouteDisplayed() to indicate if you are supplying
some sort of driving directions.
In theory, users could pan around the map using the D-pad. However, that's not
terribly useful when they have the whole world in their hands.