Android solution part of the phone connection hotspot WiFi caused to be switched, Enablenetwork (NetID, true) Invalid problem

Source: Internet
Author: User

before you write a brief introduction to the problems found:

A mobile phone to create hot "mini", b mobile phone in connection with hot spots, the connection of the SSID is called "haha", then use Enablenetwork (NetID, True) method, connection a created hot "mini", the general process is to disconnect the "haha", connect " Mini "hot spots, in this process, most of the mobile phone will be successfully connected to the" mini ", but some mobile phones such as Oppo R7 Plus can not connect to the" mini ", this model of the mobile phone connection process is to disconnect the" haha ", connect the" mini "hotspot, but the last connection or" haha "And that's why.
Originally, Wifimanager.enablenetwork (NetID, true); This method simply executes the command to connect the "specified SSID", even if returning true does not mean that the final connected WiFi is the specified Wiifi, which is why, Because our WiFi disconnect is connected to an SSID, the system reads a priority connection, determines an SSID to connect to, and we just want to connect our SSID so that at this point the equivalent of two threads at the same time, one but our SSID is connected first, System's connection the next step of the connection, it will cause the SSID we just connected, immediately disconnected.          Reference Link: http://www.bubuko.com/infodetail-1124873.html, benefit a lot

Also encountered a problem is the connection of hot WiFi wifimanager.addnetwork (wificonfig) Return of the NetID to 1, in this case directly to do the following processing, all the current problems encountered in the demo inside the deal, Children's shoes with the same problem can be downloaded to see

            Config.wepkeys[0] = "";   
              Config.hiddenssid = true;
              Config.allowedKeyManagement.set (WifiConfiguration.KeyMgmt.NONE);            config.weptxkeyindex = 0;

Download addresses for the following demo solutions

http://download.csdn.net/detail/zs20082012/9718632

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.