Perform all the steps in the above link and get the key. When we have the key than we will proceed will our development of Google Maps Application for Android.

Start a new Android Project, when prompted for SDK selection

SDK selection

Select Google APIs Platform 2.3.3 API level 10, and move next. When the project has been created. Open your MainActivity.java file. In my case I have named it GooglemapsActivity.java. Import the following.

Now add the google maps library in the manifest file, inside the application tag above the activity tag.

<uses-library android:name="com.google.android.maps"/>

Save the changes. Now Open the Android Virtual Device Manager and create a new AVD with the following settings.

Creating & Configuring New AVD

We must provide GPS and SD Card support in the AVD because we will need these two functionalities for our future tutorials. Now Right click on our googlemaps application from the PackageExplorer and click Run Configuration from Run As menu. Now Create new configuration from the selecting our googlemaps application on the Android Tab.

Run Configuration For Our Android Project

Selected Target AVD

And Select our recently created AVD from the target Tab. Click Apply and Run. Everything is fine still the application will not load any map. Reason is that, we have not created an instance of our MapView in our main GooglemapsActivity Class. To do that. Add the following lines of code below the setContentView() line.

We have provided latitude = 30 and longitude = 71, zooming level =7. The map will center at the provided coordinates at the provided zooming level. I may have forgotten to explain some details so i am attaching the complete code the 3 main files for this project.

Addressing the issues in comments from harrison , hennie and topan. The problem with force cash is solved by the following :

replace ur mapview control code in main.xml with this

<com.google.android.maps.MapView

android:id=”@+id/mapview1″

android:layout_width=”fill_parent”

android:layout_height=”322dp”

android:layout_weight=”0.64″

android:apiKey=”0VUxp2vFvlmp4w3BsQu-xxxxxxxxxxxxxxxxxxxxxxg”

android:clickable=”true” >

</com.google.android.maps.MapView>

if this doesnt work than check ur google maps api key.

The above solution worked for Harrison and his reply to me was

Mir!Thank you very much, you have gotten this to work for me! Thank you very much!The solution was:

<com.google.android.maps.MapView

>

</com.google.android.maps.MapView>For some reason it is really strict about the format of com.google.android.maps.MapViewThank you very much! Your help is GREATLY appreciated and now I can resume working on my design project.Thanks again,

Harrison

Update # 2.

Issue in which maps is not shown on the phone, if only dark screen is shown than this can be solved by zooming out a few times. Zooming out will solve the blackout screen problem. If map grid shows but no map appears than check the google maps api key.