I can't get the MapsDemo that comes with "Google APIs by Google Inc, Android API8, revision 2" to work
I have tried everything according to instructions to get the MapsDemo to work on API8. I followed all the certificate signing instructions and all I get is a blank (blue) screen on the emulator. I see that people have been having the same issues but all the suggested solutions boil down to the certificate signing and that has not worked for me. One guy on the Internet even said he got it to work but never said how!
So, I thought I'd try the MapsDemo that comes with "Google APIs by Google Inc, Android API7, revision 1". There I saw the map come up on the emulator but only once. That one time it came up clearly and I was able to pan it but after exiting the app and trying it again, it no longer worked. Now all I get is some faint outlines that makes it look like it's t开发者_StackOverflow社区rying to work but for some reason is not successful.
I am running on Windows Vista Service Pack 2 and using Eclipse Helios.
I suspect that it is working but that you are "zoomed in" over the ocean - hence the blue screen. Unfortunately the MapsDemo doesn't have the zoom widget enabled by default so this is hard to see. Try add the zoom widget, as follows, and then zoom out to a higher altitude. NB the widget only appears when you pan the map (ie drag on the map to make the widget appear, after adding this code).
Give the mapview and ID so you can access it in code - ie in res/layout/mapview.xml:
<com.google.android.maps.MapView
android:id="@+id/mapview"
Enable the zoom widget in code - ie in src/com.example.android.apis/view/MapViewDemo.java:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapview);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
精彩评论