title: android google maps show current location; map not showing
body: <p>I've been following this tutorial <a href="http://wptrafficanalyzer.in/blog/showing-current-location-in-google-maps-using-api-v2-with-supportmapfragment/" rel="nofollow">Showing current location in Google Maps using API v2</a> but whatever I do, my map just doesn't show. Screen is all grey, except the buttons for zooming. I have added permissions for the internet, I've generated API key (v2) a dozen of times (I am selecting "create new Android key..." and entering SHA1 certificate fingerprint and it generates fine), my GPS is enabled... I don't know what to do anymore. Here's my code &amp; manifest:</p>
  
  <pre><code>package com.example.myexample;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.GooglePlayServicesUtil;
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import android.location.Criteria;
  import android.location.Location;
  import android.location.LocationListener;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.app.Dialog;
  import android.support.v4.app.FragmentActivity;
  import android.widget.TextView;
  
  public class MainActivity extends FragmentActivity implements LocationListener {
  
      GoogleMap googleMap;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
      // Getting Google Play availability status
          int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
  
          if(status!=ConnectionResult.SUCCESS){ 
              int requestCode = 10;
              Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
              dialog.show();
          }
  
          else { 
  
              // Getting reference to the SupportMapFragment of activity_main.xml
              SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
              // Getting GoogleMap object from the fragment
              googleMap = fm.getMap();
              // Enabling MyLocation Layer of Google Map
              googleMap.setMyLocationEnabled(true); 
              // Getting LocationManager object from System Service LOCATION_SERVICE
              LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); 
              // Creating a criteria object to retrieve provider
              Criteria criteria = new Criteria(); 
              // Getting the name of the best provider
              String provider = locationManager.getBestProvider(criteria, true);
              // Getting Current Location
              Location location = locationManager.getLastKnownLocation(provider);
  
              if(location!=null){
                  onLocationChanged(location);
              }
              locationManager.requestLocationUpdates(provider, 20000, 0, this);
          }
      }
  
      @Override
      public void onLocationChanged(Location location) {
  
          TextView tvLocation = (TextView) findViewById(R.id.tv_location); 
          // Getting latitude of the current location
          double latitude = location.getLatitude();
          // Getting longitude of the current location
          double longitude = location.getLongitude();
          // Creating a LatLng object for the current location
          LatLng latLng = new LatLng(latitude, longitude);
          // Showing the current location in Google Map
          googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
          // Zoom in the Google Map
          googleMap.animateCamera(CameraUpdateFactory.zoomTo(15));
          // Setting latitude and longitude in the TextView tv_location
          tvLocation.setText("Latitude:" +  latitude  + ", Longitude:"+ longitude );
      }
  
  @Override
      public void onProviderDisabled(String provider) {
      // TODO Auto-generated method stub
      }
  
      @Override
      public void onProviderEnabled(String provider) {
      // TODO Auto-generated method stub
      }
  
      @Override
      public void onStatusChanged(String provider, int status, Bundle extras) {
      // TODO Auto-generated method stub
      }
  }
  </code></pre>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.myexample"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
  
      &lt;permission
          android:name="com.example.myexample.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/&gt;
  
      &lt;uses-permission android:name="com.example.myexample.permission.MAPS_RECEIVE"/&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.myexample.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="my api"/&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>