title: Making the phone silent on nearing a particular location
body: <p>I am making an android application to show the position of a user on a map, along with the users current longitude and latitude, I have also used reverse geocoding to show the address of the android device. Now I plan to add a feature that if the user is near a particular place the phone automatically switches to silent mode, for this I have made a function to check whether the phone is already silent or not. Now I want to make another one, which puts the phone in silent mode on nearing a particular location.</p>
  
  <p>The method which I have made to make the phone go silent on nearing a particular location is</p>
  
  <pre><code>public void changeToSilent(Location location){
  
      if(distanceTo(xxxx)&lt;100)
      {
          if(mPhoneIsSilent==true){
          }
          else
          {
              mPhoneIsSilent = true;
              mAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
          }
      }
  }
  </code></pre>
  
  <p>Now I am calling this method in another function, which is....</p>
  
  <p>public void onLocationChanged(Location location)
   { 
          Log.d(TAG, "onLocationChanged with location " + location.toString());   Stringtext=String.format("Lat:\t%f\nLong:\t%f\nAlt:\t%f\nBearing:\t%f",location.getLatitude(),location.getLongitude(), location.getAltitude(), location.getBearing());
  this.locationText.setText(text);</p>
  
  <pre><code>    changeToSilent(location);
  
      try {
        List&lt;Address&gt; addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 10); 
        for (Address address : addresses) {
          this.locationText.append("\n" + address.getAddressLine(0));
        }
  
        int latitude = (int)(location.getLatitude() * 1000000);
        int longitude = (int)(location.getLongitude() * 1000000);
  
        GeoPoint point = new GeoPoint(latitude,longitude);
        mapController.animateTo(point); 
  
      } catch (IOException e) {
        Log.e("LocateMe", "Could not get Geocoder data", e);
  
      }
    }
  </code></pre>
  
  <p>Now I am calling the above function in the oncreate method. Now suppose I know the latitude and longitude of the place near which the phone should go to silent.
  What I want to know is, what do I have to write in place of xxxx in the changetosilent method? </p>