Based on what @CommnsWare said, here are the steps to switch to Fused api.
Step 1. Get an instance of GoogleApiClient instead of LocationClient .
ConnectionCallback (mConnectionCallbacks, mOnConnectionFailedListener in the example below) needs a little modification, but this should be trivial.
googleApiClient = new GoogleApiClient.Builder(this) .addApi(LocationServices.API) .addConnectionCallbacks(mConnectionCallbacks) .addOnConnectionFailedListener(mOnConnectionFailedListener) .build();
Step 2. Update call connection and disconnection.
Replace locationClient.connect() with googleApiClient.connect() and locationClient.disconnect() with googleApiClient.disconnect() .
Step 3: Use LocationServices.FusedLocationApi to send your requests. eg.
LocationServices.FusedLocationApi.getLastLocation(googleApiClient) LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, mLocationListener);
Hope this helps!
Parag Sarda Dec 09 '14 at 6:40 2014-12-09 06:40
source share