当已知的 SSIS wifi 网络进入/超出范围时,有什么方法可以得到通知吗? [英] Is there any way to get notified when known SSIS wifi networks get in/out of range?

查看:9
本文介绍了当已知的 SSIS wifi 网络进入/超出范围时,有什么方法可以得到通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个应用程序,当已知的 wifi 网络进入或超出范围时执行操作.

I want to write an application which consists on perform actions when a known wifi networks get in or out of range.

例如,假设我的家庭 wifi 网络的 SSIS 是WifiHome",并且我想发出通知您刚离开家!"每当设备无法再检测到此特定网络时.(或者,当设备重新检测到来自该网络的信号时,您刚刚进入家中").

For example, let's say my home wifi network's SSIS is "WifiHome", and i want to make a notification "You just left home!" whenever the device can't detect this specific network anymore. (Or alternativly - "You just entered home" when the device re-detect signals from this network).

我的问题是:是否可以在不频繁轮询可用网络列表的情况下收听这些更改?

My question is: Is is possible to listen to those changes without polling the available-network-list frequently?

推荐答案

你应该监听广播事件 SCAN_RESULTS_AVAILABLE_ACTION.这将在每次 Wi-Fi 扫描完成时发送.当此类事件发生时,只需重新迭代可以通过 WifiManager 的 getScanResults.

You should listen to broadcast event SCAN_RESULTS_AVAILABLE_ACTION. This will be sent each time Wi-Fi scan is finished. When such event occurs just re-iterate the scan results that can be obtained via WifiManager's getScanResults.

当 wi-fi 处于活动状态时,您将每隔几秒钟收到一次此广播.但是没有办法配置这个间隔,我的猜测是每个制造商可能会改变这个间隔.

When wi-fi is active, you'll receive this broadcast every several seconds. But there is no way to configure this interval and my guess is that each manufacturer may change this interval.

您可以使用 WifiManager 的 开始扫描.

You can manually trigger wi-fi scan using WifiManager's startScan.

这篇关于当已知的 SSIS wifi 网络进入/超出范围时,有什么方法可以得到通知吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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