I am developing android application which gives notification when user enter in specific location
User can specify the location by using latitude longitude(ie Google Map)
I know how to get latitude & longitude but my problem is that when user enter in specific location then it will not exactly match with previously specified latitude & longitude.
As shown in image suppose user specify the location called "My Place" when user enter in area (about 20 meter) then application should send notification to user.
I want know how I can compare the latitude & longitude which user specified(My place) and current latitude & longitude which application fetch by GPS.
The comparison made in such way that it will true if user near by of My place in area of 20 meter.
(This 20 meters is approximate.)
Can I set accuracy of in android e.g. 20 meters.
Thank you.
Add a Location Sharing notificationIn the “Notifications” section, tap Add . Under “Choose a location,” select an address or click Add location . To choose a new location, enter an address in the search bar or click Choose on map. To set location, move your finger across the screen.
Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.
The best approach to this problem is using the GeoFences feature. Please refer to https://developer.android.com/training/location/geofencing.html for more details.
Outline: - The application registers with the underlying OS - saying - here is MY list of geofences (specific location + radius from the location) that I want you to monitor. - If my user comes within this geo fence - wake me up and tell me so. - At that point of time - you can go ahead and perform any step (either call a server and ask what information you need to display to the user) or just send a push notification (in app notification) to do the necessary work.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With