0

I am trying to create the Geofence in google location api-V2 But class LocationClient is not found in the latest version of google location library.

Is there any way to use Geofence with google api-V2

Rahul Rastogi
  • 4,486
  • 5
  • 32
  • 51

2 Answers2

1

Can't you just use the GeoFence api? https://developer.android.com/reference/com/google/android/gms/location/Geofence.html, https://developer.android.com/reference/com/google/android/gms/location/GeofencingApi.html Otherwise here's a thread on the deprecation of LocationClient: Android LocationClient class is deprecated but used in documentation

Community
  • 1
  • 1
Micky
  • 5,578
  • 7
  • 31
  • 55
  • How to get the unique id generated after the creation of a geofence? Since, it this id is needed to attach the entities to be tracked with geofence. – Rahul Rastogi Feb 24 '15 at 07:13
  • 1
    I think you need to use `Geofence.Builder setRequestId (String requestId)` and then `Geofence getRequestId()` – Micky Feb 24 '15 at 09:27
  • yes! I am already doing that. I am confused that when I would add the entities with this geofence, then, Should I consider this REQUEST_ID as the unique id with which I will add the entities to? – Rahul Rastogi Feb 24 '15 at 10:31
0

Aaahhhh..... GoogleApiClient class is doing the work here:

LocationServices.GeofencingApi.addGeofences(apiClient, geoRequest, pendingIntent);
Rahul Rastogi
  • 4,486
  • 5
  • 32
  • 51