Android play services 6.5:缺少LocationClient

Android play services 6.5:缺少LocationClient,android,location,google-play-services,android-geofence,fusedlocationproviderapi,Android,Location,Google Play Services,Android Geofence,Fusedlocationproviderapi,更新到Google Play Services 6.5.87后,由于缺少LocationCLient类,我的应用程序无法编译 当前已损坏(未找到404) 我怎样才能修好它? 我想接收位置更新、使用geofences等。LocationClient类已被替换为new和,两者都使用通用连接技术连接到Google Play服务。连接后,可以调用以下方法: LocationRequest LocationRequest=LocationRequest.create() .setPriority(位置请求

更新到Google Play Services 6.5.87后,由于缺少LocationCLient类,我的应用程序无法编译

当前已损坏(未找到404)

我怎样才能修好它?
我想接收位置更新、使用geofences等。

LocationClient类已被替换为new和,两者都使用通用连接技术连接到Google Play服务。连接后,可以调用以下方法:

LocationRequest LocationRequest=LocationRequest.create()
.setPriority(位置请求。优先级高精度);
Pendingreult结果=LocationServices.FusedLocationApi
.RequestLocationUpdate(
GoogleapClient,//您连接的GoogleapClient
locationRequest,//接收新位置的请求
位置侦听器);//将接收更新位置的侦听器
//回调是异步的。在后台线程上使用await()或侦听
//结果返回
result.setResultCallback(新的ResultCallback(){
void onResult(状态){
if(status.issucess()){
//成功注册
}else if(status.hasResolution()){
//谷歌提供了一种解决问题的方法
status.StartResult解决方案(
activity,//用于接收结果的当前activity
RESULT_CODE);//您将在
//onActivityResult方法重试注册
}否则{
//无恢复。轻轻哭泣或通知用户。
Log.e(标记“注册失败:”+status.getStatusMessage());
}
}
});

你说得对。我刚刚发现了同样的问题。谢谢!看起来他们更新了服务,但忘记了更新文档。我很好奇这对使用现在删除的LocationClient API的应用程序意味着什么,以及当用户的手机更新到最新的Google Play服务时会发生什么?由于API不再编译——应用程序会崩溃还是继续工作?@Alchete——根据以前版本的Google Play Services SDK编译的应用程序将继续工作(这很容易验证,因为每个手机都有6.5版本,但并非每个应用程序都已更新到新的API),我真的希望Google更新他们的文档。他们网站上的示例LocationProvider应用程序不再工作:@Simon-可以找到最新的Google位置示例。不知道为什么开发者网站上的样本仍然指向旧的。
LocationRequest locationRequest = LocationRequest.create()
    .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

PendingResult<Status> result = LocationServices.FusedLocationApi
    .requestLocationUpdates(
        googleApiClient,   // your connected GoogleApiClient
        locationRequest,   // a request to receive a new location
        locationListener); // the listener which will receive updated locations

// Callback is asynchronous. Use await() on a background thread or listen for
// the ResultCallback
result.setResultCallback(new ResultCallback<Status>() {
    void onResult(Status status) {
        if (status.isSuccess()) {
            // Successfully registered
        } else if (status.hasResolution()) {
            // Google provides a way to fix the issue
            status.startResolutionForResult(
                activity,     // your current activity used to receive the result
                RESULT_CODE); // the result code you'll look for in your
                              // onActivityResult method to retry registering
        } else {
            // No recovery. Weep softly or inform the user.
            Log.e(TAG, "Registering failed: " + status.getStatusMessage());
        }
   }
});