有没有办法得到通知时,称为SSIS WiFi网络获取输入/输出的范围是多少? [英] Is there any way to get notified when known SSIS wifi networks get in/out of range?
问题描述
我想写其中包括执行的操作,当一个已知的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,我想打一个通知:你刚离开家!每当设备无法检测到这种特定网络了。 (或者alternativly - 你刚刚进入家庭时,该设备从该网络重新检测信号)
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?
推荐答案
您应该听听广播事件<一href="http://developer.android.com/reference/android/net/wifi/WifiManager.html#SCAN_RESULTS_AVAILABLE_ACTION"相对=nofollow> SCAN_RESULTS_AVAILABLE_ACTION 。这将是无线网络连接,扫描完成后,每次发送。当这样的事件发生时只需重新迭代,可以通过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.
当无线网络处于活动状态,您将收到该广播每隔几秒钟。但是,有没有办法来配置这个区间,我的猜测是,每一个制造商可能会改变这一区间。
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的的 startScan 。
You can manually trigger wi-fi scan using WifiManager's startScan.
这篇关于有没有办法得到通知时,称为SSIS WiFi网络获取输入/输出的范围是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!