问题标签 [proximity]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - Proximity alerts are firing even I exit the set GPS location and occuring every 2 or 1 minute reccursively
I recently started working on proximity alerts App. This basically changes the ringtone profile (just vibrate or ringtone intially) based on the users GPS location. I completed the coding part. On "enter" and "exit" Proximity alerts are getting fired and the code in registered BroadcastReceiver is been executing. Till this point it is fine. Actual problem is as follows, (with my sample code lines)
I registered one broadcastreceiver for two Intent actions. Those Intent actions are declared as below, public static final String INTENT_ACTION1 = "org.droidmania.action.PROXIMITYALERT"; public static final String INTENT_ACTION2 = "org.droidmania.action.PROXIMITYALERT2";
And PendingIntent part is as,
private void setProximityAlerts(String intentAction){ Intent intent = new Intent(); intent.setAction(intentAction); //in case the call comes from HomeActivity intentAction will be INTENT_ACTION1 else INTENT_ACTION2
PendingIntent pIntent = PendingIntent.getBroascast(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
locationManager.addProximityAlert(latitude,longitude, vRadius, -1,pIntent); }
Now the BroadcastReceiver code,
class ProxyReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context,Intent intent){
boolean isEnter = intent.getBooleanExtra(KEY_PROXIMITY_ENTERING,false);
}
else{
//if user is out of Home location
if(intent.getAction().equals(INTENT_ACTION1)){
give the notification that user is out of home area
}
//if user is out of Office location
if(intent.getAction().equals(INTENT_ACTION2)){
give the notification that user is out of office area
}
}
}
This is the way I tested it on my mobile device,
In home I set the gps location with 10m radius. It gave me notification that "user is in home area"
It shown "user exited the home area" message when I am out of that radius.
Now when I am in office I set the gps location with 5m radius. So It gave me notification that "user is in office area". But here I am facing the actual problem as It is showing both "home area entered" and "office area entered" and "home area exited " and "office area exited" messages for every 2 or 1 minute(s) gap. I am not getting why it is happening. (Even I am not moving around after I set the office location GPS..just staying there in the same point......sitting in my office desk seat...)
Am I missing or giving something extra here? Why the alerts are occuring for home proximity as it's been long time since I exited the home area?
Guys please help me out (It's been already 2 weeks of time I spent :-( ). Your help is appreciated.
Thanks.
iphone - 使用接近传感器测量从 iPhone 到物体的距离
我已经阅读了很多关于这个主题的论坛,但我仍然没有找到一个确切的答案。iPhone 的接近传感器是否只是一个可以打开或关闭显示屏的触发器,还是可以获得传感器与物体之间的距离?
谢谢!
android - Android 位置感知应用 - 在不使用多个侦听器的情况下设置多个兴趣点
我正在制作一个应用程序,只要用户/设备接近预定义的兴趣点之一,它就会显示警报。
我发现这样做的唯一方法(实际上我让它像那样工作)是为每个兴趣点创建一个待处理的意图(具有唯一的名称)。但我认为就资源而言,这不是最好的方法。
是否可以仅使用一个待定意图而不是多个单独的意图来实现此类功能?
还有其他更好的方法吗?
提前致谢
麦克风
android - 广播接收器可以捕获多个广播吗?
我正在尝试创建多个接近警报,但我无法让它工作......
我认为广播接收器被覆盖,因此只处理最后一次广播。因此,如果我有两个点靠近最后创建意图的那个点,则会生成警报...
我读到我应该使用请求代码,但我不知道该怎么做......
我设置未决意图和广播接收器的方法...
我的广播接收器类
你能帮我么???我真的被这个困住了......
任何帮助将非常感激!!!
sql - SQL - 查找具有最接近 X 和 Y 的两列值的行
我正在建立一个网站,人们可以根据他们的体重和身高获得一些信息。一个人将如何构造一个查询,它会给我一行与用户输入的最接近的两个特定值的行?
我在 stackoverflow 上找到了这个,它非常有帮助。我正在尝试完成与仅使用 2 个值为 1 的类似的事情。
android - android多久请求一次位置更新?
android多久请求一次位置更新?例如,如果您向位置管理器添加邻近警报,它将多久更新一次位置?
在文档中它说:“如果屏幕进入睡眠状态,则每 4 分钟检查一次接近警报。通过确保设备不会永久唤醒来节省电池寿命”
但是如果屏幕不进入睡眠状态怎么办?
提前致谢
麦克风
php - 在php中计算接近度
我正在尝试编写一个 php 函数来计算两点之间的接近度,但我无法让它工作。
我目前正在使用此处找到的功能:http ://www.zipcodeworld.com/samples/distance.php.html
我的应用程序需要精确到米,但无论我做什么,我都没有得到正确的结果。
我从这里得到坐标:http: //itouchmap.com/latlong.html
我究竟做错了什么?你能帮我解决这个问题吗?
谢谢
麦克风
android - Android 传感器 - 获取接近传感器值的问题以及使用不同手机的问题
过去做过一些 Android 开发,但已经有一段时间了 - 想要构建一个使用方向和接近传感器的应用程序。所以...
所以设置监听器 - 监听所有传感器 - 想知道我应该只听两个吗?(这会节省电池吗?)
然后在 onSensorChanged - 见上文
在我的 LG Optimus One 上,我可以让它显示方向传感器的 TextViews 中的值(这款手机没有接近传感器)
但是在我的 Nexus One 上运行相同的代码会导致一个可爱的空白屏幕!?
对不起,很长的问题!但任何帮助都会很好,如果您需要更多信息,请询问,LG 手机是 2.2 Nexus One 是 2.2.2 谢谢,
大卫
factory - 推荐用于检测手部和血液的接近传感器
我的公司有兴趣为小型工业机器设计一个保护系统,工厂员工在其中插入木制物体,然后由这些机器切割。
当插入输入大厅时,保护系统需要意识到人臂的存在——然后人臂会放一块木头,机器会切割木头——但是,保护系统需要能够如果由于某种原因手臂被切断,检测血液的存在- 在这种情况下,关闭工业机器的电源。
我不是传感技术方面的专家,由于我们正在招聘一位专家,因此我正在寻求有关可以满足这些要求的适当传感技术的建议。
据我了解,电容感应 - 不仅可以检测物体的存在 - 还可以检测类型(例如区分人的手臂和血液) - 这种技术可以用于上述目的吗?
谢谢,
阿卡迪
iphone - 基于接近的设备通信或通知
在给定特定应用程序的情况下,如何根据接近度促进设备之间的通信?这个时候有可能吗?例如,如果我有一部 iPhone 或一部 iPhone 和一个基于 Android 的设备,我是否可以允许这些设备以某种方式相互传输一些信标,以便它们能够通过应用程序相互识别或至少知道它们需要此时与服务器通话并传输坐标?