title: How do I use the Android Geofencing API?
body: <p>I have been testing the new Google Play Geofencing service API.</p>
  
  <p>I downloaded the sample code from the <a href="http://developer.android.com/shareables/training/GeofenceDetection.zip" rel="nofollow">Android developers site</a>. Next, I ran the example code on an Android device (Galaxy Note 2).
  I placed my office geo-position and radius to 10m, but when I walked to my office, nothing happened.</p>
  
  <p>While running the sample code, one thing I have noticed is that when I am already inside the geofence range and then add the geofence to <code>LocationClient</code>, nothing happens.</p>
  
  <p>I had already read <a href="https://developer.android.com/reference/com/google/android/gms/location/LocationClient.html#addGeofences(java.util.List%3Ccom.google.android.gms.location.Geofence%3E%2C%20android.app.PendingIntent%2C%20com.google.android.gms.location.LocationClient.OnAddGeofencesResultListener)" rel="nofollow"><code>LocationClient</code> class documentation</a>, and found the following paragraph:</p>
  
  <blockquote>
    <p>In case network location provider is disabled by the user, the geofence service will stop updating, all registered geofences will be removed and an intent is generated by the provided pending intent. In this case, <code>hasError(Intent)</code> returns true and <code>getErrorCode(Intent)</code> returns <code>GEOFENCE_NOT_AVAILABLE</code>."</p>
  </blockquote>
  
  <p>So I turned on WiFi, and was walking to my office (inside the geofence), and then I got notification "geofence entered".</p>
  
  <p>I have the following questions:</p>
  
  <ol>
  <li><p>Does geofencing only work with WiFi enabled? </p></li>
  <li><p>Why doesn't the location provided by my 3G network work?</p></li>
  <li><p>Is this a bug in the sample code?</p></li>
  <li><p>Or is this my mistake?</p></li>
  </ol>