How to notify the user when he entered the movie theater on android?

In my Android application, I ve view the map and current location, the nearest theaters are displayed now when I want to notify the user when he entered the theater (for example, geofence), I searched in NET and found any Android api that supports Geofencing please help how to do this?

Note. I tried http://geofence.locationlabs.com/ , but that doesn’t work means that the API keys are not comig. any code sample really useful Thanks in advance

+4
source share
1 answer

Hi, I found Try This solution,

We must implement PendingIntent and Location Manager. The location manager receives the user's current location, and when the user enters a region, he will dismiss the pending code snippet as follows:

//---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, in which we can set the area (radius for tracking users) here is more detailed information about the addProximityAlert method.

+6
source

Source: https://habr.com/ru/post/1411286/


All Articles