Location Alarm for Android?
Asked Answered
P

1

7

When starting my app, several POI coordinates shall be added to the Android System. Some hours later, my app is closed and the user walks close to one of the POI he shall get notified e.g. through a status message.

Is this the right approach for my scenario? Are there more things available in Android to achieve this?

public void addProximityAlert (double latitude, double longitude, float radius, long expiration, PendingIntent intent)

Panacea answered 26/11, 2010 at 15:16 Comment(0)
A
14

Yes, you would use LocationManager and addProximityAlert() as the basis for your desired feature.

Asci answered 26/11, 2010 at 17:8 Comment(8)
Sir, is this the same as to how geofence works? I have never used geofence though i am trying to figure out how it works without it calling on gps to track the current location. If given locationmanager and geofence, then which one should be selected?Novotny
@Rat-a-tat-a-tatRatatouille: Proximity alerts never worked all that well. If you can live with the dependency on Google Play Services, using LocationClient and geofencing may give you better results.Asci
i have had an experience with the proximity alert, doesnt work on emulators :(. And i get an error 1000 while adding geofencing and i dont know why also :(..Novotny
Sir, error 1000 since the location service and gps was off. i will experiment with geo-fencing when i travel home todayNovotny
Sir, i am really sorry for so many questions, bt i am still not clear though, does geofencing handle location updates on its own ? Since with location client we can get the last known locationNovotny
@Rat-a-tat-a-tatRatatouille: I have not used the geofencing APIs. Please ask a separate Stack Overflow question.Asci
Don't we need to keep asking for location updates in case of addProximityAlert ?Meingoldas
@AjayS: To be honest, I forget. I have not looked at proximity alerts much since I wrote this answer ~7 years ago.Asci

© 2022 - 2024 — McMap. All rights reserved.