如何通知用户,当他进入android的电影院?当他、电影院、通知、用户

由网友(梦魇つつ)分享简介:在我的Andr​​oid应用程序,我已经映射视图和当前位置,最近的影院现在显示我要通知用户,当他进入了影院(如地理围栏)我搜索的.NET和力找到任何Android的API,它支​​持地理围栏,请帮助如何办呢?In my android app i ve map view and current location,ne...

在我的Andr​​oid应用程序,我已经映射视图和当前位置,最近的影院现在显示我要通知用户,当他进入了影院(如地理围栏)我搜索的.NET和力找到任何Android的API,它支​​持地理围栏,请帮助如何办呢?

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?

注:我试过 http://geofence.locationlabs.com/ 但不工作的手段API密钥不comig。 任何例如code真正的帮助在此先感谢

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,

我们必须实现PendingIntent和放大器;位置管理。位置管理器获取用户当前位置,当用户在某些地区进入将火挂起的意图一些code片段如下:

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方法中,我们可以设置区域(半径为用户跟踪) here是addProximityAlert方法的更多细节。

addProximityAlert method in which we can set the region (Radius for the User tracking) here is the more detail of addProximityAlert method.

阅读全文

相关推荐

最新文章