Search code examples
androidandroid-geofence

Why did the tutorial on Android Geofences dissapear?


This used to link to a great tutorial on how to get geofences up and running on Android called "Creating and Monitoring Geofences"

http://developer.android.com/training/location/geofencing.html

I tried going back to look at the sample code today and its gone. I dug it up in the waybackmachine though:

http://web.archive.org/web/20131203150710/http://developer.android.com/training/location/geofencing.html

Is this document no longer up to date?


Solution

  • Per the Google Play services 6.5 highlights:

    The ActivityRecognitionClient, LocationClient, and PlusClient classes are deprecated. If you used those APIs in your app and want to call Google Play services 6.5 or higher APIs, you must switch to the new programming model that utilizes GoogleApiClient. For more information about using GoogleApiClient, see Accessing Google APIs.

    Use these APIs instead of the deprecated APIs: If you were previously using LocationClient, call the APIs in the com.google.android.gms.location package instead.

    In this case, you'd use the GeofencingApi to access Geofences. Until the sample is updated to the new API, the tutorial was removed. Much of it still applies, but you'd need to substitute the new APIs where needed yourself.