Displaying Mapview In An Android Device
Solution 1:
You must check if Google Play Service is installed in your device
Google Play services is used to update Google apps and apps from Google Play. This component gives you access to Google Settings and helps apps speed up offline searches, provide more immersive maps, and improve performance. Apps may not work if you uninstall Google Play services. You probably need this component.
Get it here
Solution 2:
Google maps for android is maps v2. Google maps v2 does not suppot mapview anymore(if you have an old api key it will work for maps v1, but if you need a new key they stopped the service). So I suggest you move on to maps v2 and make use of the below code or make use of the tutorial mentioned below the code
// Getting Google Play availability statusintstatus= GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
if(status!=ConnectionResult.SUCCESS){ // Google Play Services are not availableintrequestCode=10;
Dialogdialog= GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
dialog.show();
}
else
{ // Google Play Services are available // Getting reference to the SupportMapFragmentSupportMapFragmentfragment= ( SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapfragment);
// Getting Google Map
mGoogleMap = fragment.getMap();
=============================================
you may also follow this tutorial http://www.vogella.com/articles/AndroidGoogleMaps/article.html
Post a Comment for "Displaying Mapview In An Android Device"