为什么关于 Android 地理围栏的教程消失了?
Why did the tutorial on Android Geofences dissapear?
这曾经 link 关于如何设置地理围栏的很棒的教程,运行 在 Android 上称为 "Creating and Monitoring Geofences"
http://developer.android.com/training/location/geofencing.html
我今天试着回头看示例代码,它不见了。不过我是在 waybackmachine 上挖出来的:
此文档不再是最新的了吗?
根据 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.
在这种情况下,您将使用 GeofencingApi 访问地理围栏。直到示例更新到新的 API,教程才被删除。其中大部分内容仍然适用,但您需要自己在需要的地方替换新的 API。
这曾经 link 关于如何设置地理围栏的很棒的教程,运行 在 Android 上称为 "Creating and Monitoring Geofences"
http://developer.android.com/training/location/geofencing.html
我今天试着回头看示例代码,它不见了。不过我是在 waybackmachine 上挖出来的:
此文档不再是最新的了吗?
根据 Google Play services 6.5 highlights:
The
ActivityRecognitionClient
,LocationClient
, andPlusClient
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.
在这种情况下,您将使用 GeofencingApi 访问地理围栏。直到示例更新到新的 API,教程才被删除。其中大部分内容仍然适用,但您需要自己在需要的地方替换新的 API。