如何通知用户,当他进入android的电影院? [英] How to notify user when he entered into a Movie theater in android?

查看:87
本文介绍了如何通知用户,当他进入android的电影院?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的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方法中,我们可以设置区域(半径为用户跟踪) <一href="http://developer.android.com/reference/android/location/LocationManager.html#addProximityAlert%28double,%20double,%20float,%20long,%20android.app.PendingIntent%29">here是addProximityAlert方法的更多细节。

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

这篇关于如何通知用户,当他进入android的电影院?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆