title: Get path and Distance from my current location to user input location
body: <p>What i want is that user provide location name from EditText.
  Then user click search location button.
  Then pin point user input and user's current location and calculate the distance from current location to user searched location and draw line .
  I have done following code which only show google map.Yet not included EditText also.
  where i have to include to EditText and Button ?</p>
  
  <p><strong>AndroidManifest.xml</strong></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.joshclemm.android.tutorial"
        android:versionCode="1"
        android:versionName="1.0"&gt;
      &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
          &lt;activity android:name=".MyMapLocationActivity"
                    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;!-- Make sure the uses-library line is inside the application tag --&gt;
      &lt;uses-library android:name="com.google.android.maps" /&gt;
      &lt;/application&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;/manifest&gt; 
  </code></pre>
  
  <p><strong>main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  
      &lt;com.google.android.maps.MapView
          android:id="@+id/mapview"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:apiKey="My Api key"
          android:clickable="true" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>FixedMyLocationoverlay.java</strong></p>
  
  <pre><code>import android.content.Context;
  import android.graphics.Canvas;
  import android.graphics.Paint;
  import android.graphics.Point;
  import android.graphics.Paint.Style;
  import android.graphics.drawable.Drawable;
  import android.location.Location;
  
  import com.google.android.maps.GeoPoint;
  import com.google.android.maps.MapView;
  import com.google.android.maps.MyLocationOverlay;
  import com.google.android.maps.Projection;
  
  
  public class FixedMyLocationOverlay extends MyLocationOverlay {
  
      private boolean bugged = false;
  
      private Drawable drawable;
      private Paint accuracyPaint;
      private Point center;
      private Point left;
      private int width;
      private int height;
  
      public FixedMyLocationOverlay(Context context, MapView mapView) {
          super(context, mapView);
      }
  
      @Override
      protected void drawMyLocation(Canvas canvas, MapView mapView,
              Location lastFix, GeoPoint myLocation, long when) {
          if (!bugged) {
              try {
                  super.drawMyLocation(canvas, mapView, lastFix, myLocation, when);
              } catch (Exception e) {
                  // we found a buggy phone, draw the location icons ourselves
                  bugged = true;
              }
          }
  
          if (bugged) {
              if (drawable == null) {
  
                  accuracyPaint = new Paint();
                  accuracyPaint.setAntiAlias(true);
                  accuracyPaint.setStrokeWidth(2.0f);
  
                  drawable = mapView
                          .getContext()
                          .getResources()
                          .getDrawable(
                                  R.drawable.ic_maps_indicator_current_position);
                  width = drawable.getIntrinsicWidth();
                  height = drawable.getIntrinsicHeight();
                  center = new Point();
                  left = new Point();
              }
  
              Projection projection = mapView.getProjection();
              double latitude = lastFix.getLatitude();
              double longitude = lastFix.getLongitude();
              float accuracy = lastFix.getAccuracy();
  
              float[] result = new float[1];
  
              Location.distanceBetween(latitude, longitude, latitude,
                      longitude + 1, result);
              float longitudeLineDistance = result[0];
  
              GeoPoint leftGeo = new GeoPoint(
                      (int) (latitude * 1e6),
                      (int) ((longitude - accuracy / longitudeLineDistance) * 1e6));
              projection.toPixels(leftGeo, left);
              projection.toPixels(myLocation, center);
              int radius = center.x - left.x;
  
              accuracyPaint.setColor(0xff6666ff);
              accuracyPaint.setStyle(Style.STROKE);
              canvas.drawCircle(center.x, center.y, radius, accuracyPaint);
  
              accuracyPaint.setColor(0x186666ff);
              accuracyPaint.setStyle(Style.FILL);
              canvas.drawCircle(center.x, center.y, radius, accuracyPaint);
  
              drawable.setBounds(center.x - width / 2, center.y - height / 2,
                      center.x + width / 2, center.y + height / 2);
              drawable.draw(canvas);
          }
      }
  }
  </code></pre>
  
  <p><strong>MyLocationMapActivity.java</strong></p>
  
  <pre><code>import android.os.Bundle;
  import android.widget.Toast;
  
  import com.google.android.maps.GeoPoint;
  import com.google.android.maps.MapActivity;
  import com.google.android.maps.MapView;
  import com.google.android.maps.MyLocationOverlay;
  
  public class MyMapLocationActivity extends MapActivity {
  
      private MapView mapView;
      private MyLocationOverlay myLocationOverlay;
  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.main); 
  
          mapView = (MapView) findViewById(R.id.mapview);
          mapView.setBuiltInZoomControls(true);
          myLocationOverlay = new FixedMyLocationOverlay(this, mapView);
          mapView.getOverlays().add(myLocationOverlay);
          mapView.postInvalidate();
          zoomToMyLocation();
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          myLocationOverlay.enableMyLocation();
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          myLocationOverlay.disableMyLocation();
      }
  
  
      private void zoomToMyLocation() {
          GeoPoint myLocationGeoPoint = myLocationOverlay.getMyLocation();
          if(myLocationGeoPoint != null) {
              mapView.getController().animateTo(myLocationGeoPoint);
              mapView.getController().setZoom(10);
          }
          else {
              Toast.makeText(this, "Cannot determine location", Toast.LENGTH_SHORT).show();
          }
      }
  
      @Override
      protected boolean isRouteDisplayed() {
          return false;
      }
  }
  </code></pre>
  
  <p>Help me.</p>