WifiConfiguration config = new WifiConfiguration();
config.SSID = "\"WIFI_NAME\"";
config.preSharedKey = "\"PASSWORD\"";
config.hiddenSSID = true;
config.status = WifiConfiguration.Status.ENABLED;
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
config.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
int netId = manager.addNetwork(config);
boolean b = manager.enableNetwork(netId, true);

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 一周 Go World 新鲜事
  2. 快递100电商快递地图轨迹推送服务API接口
  3. 关键路径(C语言)
  4. 焕新2021 | Palo Alto Networks(派拓网络)
  5. 快递100查询地图轨迹API接口案例代码
  6. Ceph最新版Dashboard初探
  7. 5G时代,互联网***的“道”与“术”
  8. C语言动态内存函数的理解和总结
  9. API文档工具是什么?附带6款好用的API文档
  10. “驯服云野兽”:自节点而上,Kubernetes安全