Installation guide

28
mapView.setSatellite(false);
//get map controller
mapController = mapView.getController();
//set the initial zoom level
mapController.setZoom(10);
//move the location to Stockholm at the time when the map was loaded
mapController.animateTo(point);
Change public class MainActivity extends Activity into public class MainActivity extends
MapActivity.
Define three variables as follows in the public class MainActivity extends MapActivity.
private MapView mapView;
private MapController mapController;
private GeoPoint point;
Do some necessary modification to ensure MainActivity.java includes following imports.
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.os.Bundle;
import android.view.Menu;
1.5. Edit AndroidManifest.xml
Double click AndroidManifest.xml and choose AndroidManifest.xml tab.
To ensure the application could find the package of Google Map, add <uses-library
android:name="com.google.android.maps" /> between </activity> and </application>.
To ensure our application has the permission to use Internet connection, add
<uses-permission android:name="android.permission.INTERNET"/> after <uses-sdk
android:minSdkVersion="7" />.
1.6. Run the Android Emulator
Before you run the emulator, make sure Google APIs7 has already lunched in Android
Virtual Devices Manager. Good luck if Google map jumps up after running the emulator.
Have a screen shot for your fantastic work.
Section 2 Display OSM Map
Produce to create OSM map in Android is much simpler compared with section 1, since API key
is not required for OSM map in Android.
File -> New -> Other -> Android Android Application Project Next -> fill OSM
(Application Name), OsmPro (Project Name) and com.osm.project (Package Name) in the
fields, select Android 2.1 (API 7) for Build SDK, select API 7: Android 2.1 (Eclair) for
Minimum Required SDK Next -> Next -> Next -> Finish.
Physically copy osmdroid-android-3.0.2.jar and slf4j-android-1.5.8.jar to the project folder
of libs and press F5 to refresh the project.