android学习 wifi连接的注意的问题
来源:互联网 发布:网络6524是什么意思啊 编辑:程序博客网 时间:2024/05/16 08:16
1。注意 xml String双引号“ ”的细节。
info.getSSID()
String android.net.wifi.WifiInfo.getSSID()
Returns the service set identifier (SSID) of the current 802.11 network. If the SSID can be decoded as UTF-8,it will be returned surrounded by double quotation marks. Otherwise, it is returned as a string of hex digits. The SSID may benull
if there is no network currently connected.
在用SharedPreferences存储相应 SSID时候, 对比匹配,要注意双引号的问题。。
2。public List<WifiConfiguration> getConfiguredNetworks()
Upon failure to fetch or when when Wi-Fi is turned off, it can be null.
所以使用前要 先判断 wifiMangager.wifistate()== enabled时,才getConfiguredNetworks();否则空指针异常。 list返回NULL
总来说是 wifiMangager和SharedPreferences的运用。
3.无认证的wifi总是连接不上
http://bbs.csdn.net/topics/390557674
config.wepKeys[0] = "\"" + "\"";这个原因;、
4.总是显示上一次连接
应该先 断开以前的wifi连接 wifiMangager.disconnect();再连接新的wifi。 以保障wifiMangager不会存储上次的信息
5.机顶盒重新开机后连不上 关机前保存的wifi.而不关机重新运行apk却可以
因为重启后硬件驱动启动需要时间, 所以重启的时候,先判断ConnectivityManager.getActiveNetworkInfo()是否为NULL, 直接延时30S。。。不过这样做是不是太慢了?
- android学习 wifi连接的注意的问题
- Android 连接指定的wifi
- Android网络连接Wifi和cmnet及cmwap的问题
- Android 解决黑屏时wifi断开连接的问题
- android的wifi学习
- Android wifi 连接问题
- 学习Android 注意的十个问题
- 学习Android 应注意的十个问题
- Android代码连接Wifi时被系统切换到其他Wifi的问题
- Android代码连接Wifi时被系统切换到其他Wifi的问题
- Android代码连接Wifi时被系统切换到其他Wifi的问题
- Android代码连接Wifi时被系统切换到其他Wifi的问题
- 一、adb-wifi连接注意问题
- android之ConnectivityManager ,网络连接状态的一些注意问题
- android 注意的问题
- 关于连接无密码的wifi问题
- ubuntu 14.04 wifi无法连接的问题
- 关于wifi连接不上的问题
- 运维部航显运维小组访谈提纲-航显系统研究第92篇
- 数据结构上机题目--MST
- 计算机网络笔试题
- new和malloc的区别
- java下载网络文件, ppt,pdf,图片
- android学习 wifi连接的注意的问题
- 结构体定义寄存器方法(很流行哦)
- ABAP取字符串中的连续数字
- 数学专项number_theory:LA 4382
- 将网页添加至收藏夹代码
- 2013-10-28
- 数据结构上机题目--dijkstra
- C语言学生信息管理系统 (单链表版)【无图,未调试】
- sqlite数据库执行监控