title: cannot resolve symbol ConnectionCallbacks
body: <p>I am new to android. I am using android studio. I am trying to build an application which can send current location to my friend. I am following <a href="https://developers.google.com/" rel="nofollow noreferrer">https://developers.google.com/</a>, But when I tried to implement <code>ConnectionCallbacks</code> and <code>OnConnectionFailedListener</code>, in the main activity, it shows an error like</p>
  
  <pre><code>:cannot resolve symbol ConnectionCallbacks
  </code></pre>
  
  <p>I tried changing</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener{ };
  </code></pre>
  
  <p>to</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
  </code></pre>
  
  <p>but didn't help.</p>
  
  <p><code>mainActivity.java</code></p>
  
  <pre><code>package com.example.manju.helpme;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.telephony.SmsManager;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.Button;
  import com.google.android.gms.common.api.GoogleApiClient;
  import com.google.android.gms.location.LocationServices;
  
  public class MainActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener{
  
  /* called when user clicks ALERT! button*/
  
  
  public void sendMessage(){
  
      String phoneNo = "1234567890";
      String message = "hi";
      SmsManager smsManager = SmsManager.getDefault();
      smsManager.sendTextMessage(phoneNo, null, message, null, null);
  
  }
  
  protected synchronized void buildGoogleApiClient(){
    GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API)
            .build();
  }
  
      @Override
      public void onConnected(Bundle connectionHint)
      {
          mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
          if(mLastLocation != null){
                mLatitudeText.setText(String.valueOf(mLastLocation.getLatitude()));
              mLongitudeText.setText(String.valueOf(mLastLocation.getLongitude()));
          }
      }
  }
  
  @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Button btnAlert = (Button)findViewById(R.id.btn_Alert);
      Button btnAddGuardian = (Button)findViewById(R.id.btn_Add_Guardian);
      Button btnRemoveGuardian= (Button)findViewById(R.id.btn_Remove_Guardian);
  
  
  
      btnAlert.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              sendMessage();
          }
      });
  
      btnAddGuardian.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
          }
      });
  
  
      btnRemoveGuardian.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
          }
      });
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
  
      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  }
  </code></pre>
  
  <p><code>gradle.build</code></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  compileSdkVersion 23
  buildToolsVersion "23.0.0"
  
  defaultConfig {
      applicationId "com.example.manju.helpme"
      minSdkVersion 15
      targetSdkVersion 23
      versionCode 1
      versionName "1.0"
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  }
  
  dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile 'com.google.android.gms:play-services:7.8.0'
  }
  </code></pre>
  
  <p><code>androidManifest.xml</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.manju.helpme" &gt;
  
  
  &lt;uses-permission android:name="android.permission.SEND_SMS"&gt; &lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  
  &lt;meta-data android:name="com.google.android.gms.version"
      android:value="@integer/google_play_services_version" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
  
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name"
          &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".Guardians"
          android:label="@string/title_activity_guardians"
          android:parentActivityName=".MainActivity" &gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.example.manju.helpme.MainActivity" /&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>