简体   繁体   中英

Not able to receive geofence alert in android

I have implemented Geofencing in my app using the android demo( http://developer.android.com/training/location/geofencing.html ). The problem is that i get accurate alert notification only when google maps or any another app which request for location update is open and that with GPS enabled. I don't get any alert notification when my 3g or wifi is on. I have kept 1000m as geofence radius. Even when my 3g or wifi is on and i am standing in the middle of the geofence area i don't get alert notification.

Do I need to request location update manually or it takes time for geofence to trigger a alert notification?

My geofences work OK when I first call requestLocationUpdates and in the onLocationChanged callback add geofences to the LocationClient

So your assumption most likely is correct that manual update is needed.

I have also set polling of location to 1 min or 100m, so my application behaves like maps, getting the location all the time. API for this is LocationManager.requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM