title: Find My Location On Google Maps
body: <p>i am trying to make the application display my location on google maps with a geapoint, but it always opens the same place when opening the application on my phone, which is the value i added in the code as an initial value for the testing on the compiler.
  how can i make it display my location(make it change the Latitude and longitude according to my place)?</p>
  
  <p>here is the code:</p>
  
  <p>public class AndroidGoogleMapsActivity extends MapActivity {</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      // Displaying Zooming controls
      MapView mapView = (MapView) findViewById(R.id.mapView);
      mapView.setBuiltInZoomControls(true);
  
      /**
       * Changing Map Type
       * */
       mapView.setSatellite(true); // Satellite View
      // mapView.setStreetView(true); // Street View
       mapView.setTraffic(true); // Traffic view
  
      /**
       * showing location by Latitude and Longitude
       * */        
      MapController mc = mapView.getController();
      double lat = Double.parseDouble("31.894178");
      double lon = Double.parseDouble("35.872694");
      GeoPoint geoPoint = new GeoPoint((int)(lat * 1E6), (int)(lon * 1E6));
      mc.animateTo(geoPoint);
      mc.setZoom(15);
      mapView.invalidate(); 
  
  
  
      /**
       * Placing Marker
       * */
      List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();
      Drawable drawable = this.getResources().getDrawable(R.drawable.mark_red);
      AddItemizedOverlay itemizedOverlay = 
           new AddItemizedOverlay(drawable, this);
  
  
      OverlayItem overlayitem = new OverlayItem(geoPoint, "Hello", "Sample Overlay item");
  
      itemizedOverlay.addOverlay(overlayitem);
      mapOverlays.add(itemizedOverlay);
  
  }
  
  @Override
  protected boolean isRouteDisplayed() {
      return false;
  }
  </code></pre>
  
  <p>}</p>