title: How to add marker on user current position and show current local place name in title?
body: <p>I want to create app for current GPS location tracker. Now what I want that How can I add marker on user current position and also I want to show current local place name as a title. how can I achieve this ?</p>
  
  <p>Activity Code -</p>
  
  <pre><code>public class MyActivity extends FragmentActivity implements LocationListener {
  
      GoogleMap googleMap;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //show error dialog if GoolglePlayServices not available
          if (!isGooglePlayServicesAvailable()) {
              finish();
          }
          setContentView(R.layout.activity_my);
          SupportMapFragment supportMapFragment =
                  (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.googleMap);
          googleMap = supportMapFragment.getMap();
          googleMap.setMyLocationEnabled(true);
          LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
          Criteria criteria = new Criteria();
          String bestProvider = locationManager.getBestProvider(criteria, true);
          if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
              // TODO: Consider calling
              //    ActivityCompat#requestPermissions
              // here to request the missing permissions, and then overriding
              //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
              //                                          int[] grantResults)
              // to handle the case where the user grants the permission. See the documentation
              // for ActivityCompat#requestPermissions for more details.
              return;
          }
          Location location = locationManager.getLastKnownLocation(bestProvider);
          if (location != null) {
              onLocationChanged(location);
          }
          locationManager.requestLocationUpdates(bestProvider, 20000, 0, this);
      }
  
      @Override
      public void onLocationChanged(Location location) {
          TextView locationTv = (TextView) findViewById(R.id.latlongLocation);
          double latitude = location.getLatitude();
          double longitude = location.getLongitude();
          LatLng latLng = new LatLng(latitude, longitude);
          googleMap.addMarker(new MarkerOptions().position(latLng).icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_launcher)));
          googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
          googleMap.animateCamera(CameraUpdateFactory.zoomTo(15));
          locationTv.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
      }
  
      private boolean isGooglePlayServicesAvailable() {
          int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
          if (ConnectionResult.SUCCESS == status) {
              return true;
          } else {
              GooglePlayServicesUtil.getErrorDialog(status, this, 0).show();
              return false;
          }
      }
  }
  </code></pre>
  
  <p>Xml file code - </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MyActivity"&gt;
  
      &lt;fragment
          android:id="@+id/googleMap"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          class="com.google.android.gms.maps.SupportMapFragment"
          android:layout_above="@+id/latlongLocation" /&gt;
  
      &lt;TextView
          android:id="@+id/latlongLocation"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:gravity="bottom"
          android:layout_alignParentBottom="true"
          android:background="#ff058fff"
          android:paddingTop="5dp"
          android:paddingBottom="5dp"
          android:textColor="#ffffffff"
          android:paddingLeft="5dp"
          android:paddingRight="5dp" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>