-2

I'm using geo-fences radius in my Android application. I did geo-fences in Android, I got notifications too.

My problem is if I entered a geo-fence radius as 200 meters and the current location radius on the map is 100 meters, then I am getting notifications but if the geofence radius is in 10 meters or less I did not getting any notification.

How can I get accurate notifications with the 2 meter geo-fencing radius?

Pushpa Latha
  • 139
  • 1
  • 1
  • 12

1 Answers1

0

As far as I understood from my tests with mock locations, you get the notifications only when your position + accuracy is fully inside the geofence area. So in this case, you would get the notification only if your accuracy radius is under 2 meters and fully inside the geofence area.

N Dorigatti
  • 3,482
  • 2
  • 22
  • 33
  • Thanks for Reply, i am new to this concept, if do not mind what it mean Mock Locations? may i give any permission to manifest file (is there any use of it i did not do) or any mock lock location implementation i need to do in my app? and also how can i get exact location(current location) – Pushpa Latha Feb 10 '16 at 09:18
  • Mock location is a technique to "fake" your location by code, is just to avoid wandering with the phone abroad. For your specific issue, I would read the end of this link: http://developer.android.com/training/location/geofencing.html For using mock location, you can start from here http://developer.android.com/guide/topics/location/strategies.html#MockData and check the official examples, I couldn't remember the name but there is one with code example! – N Dorigatti Feb 10 '16 at 09:30
  • may i need to use Mock location with GPS or need to use seperately? – Pushpa Latha Feb 10 '16 at 09:39
  • mock location is a way to simulate GPS positions, so you would use it to stay in office and fake your position around the world or for demo purposes. If you use mock location provider your GPS is ignored – N Dorigatti Feb 10 '16 at 09:53
  • My exact problem is whenever i am entering/exiting in to my office ,it needs notify in notification.setted radius as 10 meters but its not comimg but if it is 200meters its working fine. and didi whatever you told ,but still am enable to get? what i need to do? – Pushpa Latha Feb 10 '16 at 11:17
  • maybe you can't, because as stated, if the accuracy of your device is bigger than 10meters you will never get the notification. I have to check the accuracy (normally the blue radius around your position, how big it is). Just for your tests, draw the geofence in map and check if the accuracy is fully inside or not this drawn area – N Dorigatti Feb 10 '16 at 11:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/103092/discussion-between-pushpa-latha-and-n-dorigatti). – Pushpa Latha Feb 10 '16 at 12:41