jibysthomas
jibysthomas

Reputation: 1621

Proximity Alert Service in background

I am developing an application in which i need a proximity alert when the user enter a specific location with a given Latitude, longitude and radius. I had written a service which implements LocationListenerand listen by a BroadcastReceiver to put a notification when the user is in the proximity. Everything working fine, but when i am deleting the application from the recent application list it no more sending the broadcast intent. But according to my actual requirement even if the user delete the application from the recent list or the application is not in the background i need to get a notification when the user is in the particular latitude and longitude with the given radius.

Upvotes: 0

Views: 1306

Answers (1)

Ron
Ron

Reputation: 24235

I think you are doing it wrong. I would be sure if provided some code in your post.

You must use LocationManager for such requirements. Read documentation here. The first lines say

This class provides access to the system location services. These services allow applications to obtain periodic updates of the device's geographical location, or to fire an application-specified Intent when the device enters the proximity of a given geographical location.

Use its API addProximityAlert to register for an proximity alert even when your app is not running.

Upvotes: 4

Related Questions