In my android app i ve map view and current location,nearest theaters displayed now i want to notify user when he entered into a theater(like geofence) i searched on NET and dint find any Android api which supports Geofencing please help how to do it?
Note:I tried http://geofence.locationlabs.com/ but not working means API keys are not comig. any example code really helpful Thanks in advance
Hey I found the solution Try This,
We have to implement PendingIntent & Location Manager. Location Manager obtain the current Location of user and when user entered in some region it will fire a pending intent some code snippet as follow:
//---use the LocationManager class to obtain locations data---
lm = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
//---PendingIntent to launch activity if the user is within some locations---
PendingIntent pendIntent = PendingIntent.getActivity(
this, 0, new
Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://www.amazon.com")), 0);
lm.addProximityAlert(37.422006, -122.084095, 5, -1, pendIntent);
addProximityAlert method in which we can set the region (Radius for the User tracking) here is the more detail of addProximityAlert method.
来源:https://stackoverflow.com/questions/10497977/how-to-notify-user-when-he-entered-into-a-movie-theater-in-android