你们中的 Android 专家知道任何开源代码来创建一个WifiConfiguration http://developer.android.com/reference/android/net/wifi/WifiConfiguration.html从给定的ScanResult http://developer.android.com/reference/android/net/wifi/ScanResult.html#capabilities?这会有帮助的。事实上,我捕获的 Android 源代码(2012 年 4 月中旬)的第 483 行(/624)WifiConfiguration.java
是一个注释掉的构造函数,旨在执行此操作,有一个很大的 TODO 想知道它是否值得实现(请参阅下面的引用)。我示意是,我可以听一下吗?
我看到的主要挑战(实际上是这个问题的首要挑战)是如何解释 ScanResult.configuration 字符串。
- 我可以期待一个简单的列表吗
[WPA2-PSK-CCMP]
, [WPS]
, etc?
- 这些字符串是否在文档或代码库中的某个位置枚举?
- 是否有设备/制造商/AP 特定的字符串 I
应该知道什么?
From WifiConfiguration.java
(可能有社论):
/**
* Construct a WifiConfiguration from a scanned network
* @param scannedAP the scan result used to construct the config entry
* TODO: figure out whether this is a useful way to construct a new entry.
*
public WifiConfiguration(ScanResult scannedAP) {
networkId = -1;
SSID = scannedAP.SSID;
BSSID = scannedAP.BSSID;
// aaaah screw it I'm tired/lazy
}
*/
https://code.google.com/p/android/issues/detail?id=60523 https://code.google.com/p/android/issues/detail?id=60523
我找到了这个项目https://github.com/mkch/android-wifi-connecter https://github.com/mkch/android-wifi-connecter以下文件特别有用:
无线网络.java https://github.com/mkch/android-wifi-connecter/blob/master/app/src/main/java/com/farproc/wifi/connecter/Wifi.java
配置SecuritiesV8.java https://github.com/mkch/android-wifi-connecter/blob/master/app/src/main/java/com/farproc/wifi/connecter/ConfigurationSecuritiesV8.java
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)