title: Android LocationServices.FusedLocationApi deprecated
body: <p>I couldn't figure out why <code>LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient,mLocationRequest, this);</code> "FusedLocationApi" is cross out and point at it saying is deprecated.
  <a href="https://i.stack.imgur.com/mML1U.jpg" rel="noreferrer">Click here to view Image</a></p>
  
  <pre><code>import android.location.Location;
  import android.location.LocationListener;
  import android.support.annotation.NonNull;
  import android.support.annotation.Nullable;
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.api.GoogleApiClient;
  import com.google.android.gms.location.LocationRequest;
  import com.google.android.gms.location.LocationServices;
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  public class MaintainerMapActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener{
  
  private GoogleMap mMap;
  GoogleApiClient mGoogleApiClient;
  Location mLastLocaton;
  LocationRequest mLocationRequest;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_maintainer_map2);
      // Obtain the SupportMapFragment and get notified when the map is ready to be used.
      SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
              .findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
  }
  
  
  @Override
  public void onMapReady(GoogleMap googleMap) {
      mMap = googleMap;
  
      // Add a marker in Sydney and move the camera
      LatLng sydney = new LatLng(-34, 151);
      mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
      mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
  }
  
  @Override
  public void onLocationChanged(Location location) {
  
  }
  
  @Override
  public void onStatusChanged(String provider, int status, Bundle extras) {
  
  }
  
  @Override
  public void onProviderEnabled(String provider) {
  
  }
  
  @Override
  public void onProviderDisabled(String provider) {
  
  }
  
  @Override
  public void onConnected(@Nullable Bundle bundle) {
      mLocationRequest = new LocationRequest();
      mLocationRequest.setInterval(1000);
      mLocationRequest.setFastestInterval(1000);
      mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
  
      LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient,mLocationRequest, this);
  }
  
  @Override
  public void onConnectionSuspended(int i) {
  
  }
  
  @Override
  public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
  
  }
  }
  </code></pre>