LocationClient无法在android studio中解析符号



下面是我的build.gradle文件

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    defaultConfig {
        applicationId "com.domore.googlelocationdemo"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    //compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.google.android.gms:play-services:6.5.87'
}

这是我的主要活动.java

package com.domore.googlelocationdemo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;

public class MainActivity extends AppCompatActivity implements GooglePlayServicesClient.ConnectionCallbacks,
GooglePlayServicesClient.OnConnectionFailedListener{
    LocationClien
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    @Override
    public void onConnected(Bundle bundle) {
    }
    @Override
    public void onDisconnected() {
    }
    @Override
    public void onConnectionFailed(ConnectionResult connectionResult) {
    }
}

我需要做什么?请有人帮我解决这个错误吗?

我使用了LocationRequest类,但我需要哪个参数来设置LocationRequeset类构造函数?

因为编译的sdk版本作为LocationClient在API23中被弃用,所以您可以使用新的库

com.google.android.gms.common.api.GoogleApiClient and 
com.google.android.gms.location.LocationRequest.

最新更新