Android10连接WiFi,一直报错,很少成功过,这bug到底要多久才能修复啊
wx.connectWifi(Object object)在Android10系统的手机一直failwx.connectWifi(Object object)在Android10系统的手机一直fail,返回12003,Android10增加了新的API,请尽快支持: https://developer.android.google.cn/guide/topics/connectivity/wifi-bootstrap.md final NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder() .setSsidPattern(new PatternMatcher("test", PatternMatcher.PATTERN_PREFIX)) .setBssidPattern(MacAddress.fromString("10:03:23:00:00:00"), MacAddress.fromString("ff:ff:ff:00:00:00")) .build(); final NetworkRequest request = new NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) .removeCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) .setNetworkSpecifier(specifier) .build(); final ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); final NetworkCallback networkCallback = new NetworkCallback() { ... @Override void onAvailable(...) { // do success processing here.. } @Override void onUnavailable(...) { // do failure processing here.. } ... }; connectivityManager.requestNetwork(request, networkCallback); ... // Release the request when done. connectivityManager.unregisterNetworkCallback(networkCallback);
2020-08-05