Search code examples
androidandroid-5.0-lollipopgeofencing

Geofencing and Lollipop


I want to create a geofencing app with android 5.0 (Lollipop). But as I go through this google link http://developer.android.com/training/location/geofencing.html i realized that google uses the LocationClient class which has been deprecated. So my question is, how do I get geofencing updates with the GoogleApiClient?

here is the code that I need to replace:

 mLocationClient.addGeofences( 
                    mCurrentGeofences, pendingIntent, this);

mLocationClient is from LocationClient class.


Solution

  • Found the answer

    LocationServices.FusedLocationApi.requestLocationUpdates(
                mGoogleApiClient, mLocationRequest, this);