Installation guide

27
the content of the page to a .txt file for later usage.
Link-1: http://code.google.com/android/maps-api-signup.html
1.3. Edit res/layout/activity_main.xml for the UI Designing
Delete the following code, since it is useless and will be covered by Google map.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
Instead copy the following code, which comes from the .txt file in Section 1. Add two lines
of code of android:id="@+id/mapview" and android:clickable="true". Then save this file.
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0sl-j0Aq8pcpjhlkSjpRgIRZygDhvljxU9eWjXg"/>
1.4. Edit MainActivity.java
Copy the following code exactly following setContentView(R.layout.activity_main).
//set the location(latitude and latitude) of Stockholm
point = new GeoPoint(59398056, 18023222);
//instantiate the variable mapView and specify that its layout is located in the tag named mapview
mapView = (MapView) findViewById(R.id.mapview);
//enable the built-in zoom controls
mapView.setBuiltInZoomControls(true);
//use road map instead of satellite map