wifimanager

Can't connect to WiFi network

走远了吗. 提交于 2019-12-02 13:03:20
问题 I am new to android development and was trying to connect to WiFi network using the Android SDK. The code for disconnect works fine but re-connection fails. Here's the code that i have try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; // Please note the quotes. String should contain SSID in quotes conf.wepKeys[0] = password; //WEP password is in hex, we do not need to surround it with quotes. conf.wepTxKeyIndex = 0; conf.allowedKeyManagement.set

Is it possible to programatically enable wifi on Android 10 devices?

蓝咒 提交于 2019-12-02 07:53:20
Since setWifiEnabled is deprecated on Android 10, how does one programatically enable wifi on Android 10 devices? Is it not possible to programatically enable wifi at all on Android 10+ (SDK 29) ? No, This is not possible to enable or disable Wi-Fi programmatically from Android-10 API level 29 [ Until google provides an alternative solution ]. For applications targeting Build.VERSION_CODES.Q or above, this API will always return false and will have no effect. If apps are targeting an older SDK ( Build.VERSION_CODES.P or below), they can continue to use this API. There is an issue 128554616

Can't connect to WiFi network

℡╲_俬逩灬. 提交于 2019-12-02 04:46:06
I am new to android development and was trying to connect to WiFi network using the Android SDK. The code for disconnect works fine but re-connection fails. Here's the code that i have try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; // Please note the quotes. String should contain SSID in quotes conf.wepKeys[0] = password; //WEP password is in hex, we do not need to surround it with quotes. conf.wepTxKeyIndex = 0; conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);

Can't set “WifiConfiguration” when enabling wifi-hotspot using “setWifiApEnabled”

大兔子大兔子 提交于 2019-12-02 01:21:34
I'm trying to set my Android device to be an Access-Point using the code I've seen here before: WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiConfiguration netConfig = new WifiConfiguration(); netConfig.SSID = "MyAccessPoint"; Method method = wifi.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, boolean.class); method.invoke(wifi, netConfig, true); now, I managed to turning it on but without the SSID which I set in WifiConfiguration. This is driving me crazy. Anyone? bbodenmiller See how I got this working at Android 2.3 wifi hotspot API . Before

Missing method in android.net.wifi.WifiManager

时光怂恿深爱的人放手 提交于 2019-12-01 21:01:09
问题 On the site androidjavadoc.com, a method startScanActive is listed in the class WifiManager that makes it possible to perform an active wi-fi scan. It has been discussed here recently, too. Nevertheless, when I try to use that method in Eclipse, it is not found (undefined). startScan is. I tried that with all android.jar versions coming with the Android SDK (from 2.3 to 3.1). Does the function exist? How can I get access to it? Thanks a lot 回答1: As I mentioned, look at the official

Missing method in android.net.wifi.WifiManager

萝らか妹 提交于 2019-12-01 19:02:19
On the site androidjavadoc.com , a method startScanActive is listed in the class WifiManager that makes it possible to perform an active wi-fi scan. It has been discussed here recently, too. Nevertheless, when I try to use that method in Eclipse, it is not found (undefined). startScan is. I tried that with all android.jar versions coming with the Android SDK (from 2.3 to 3.1). Does the function exist? How can I get access to it? Thanks a lot As I mentioned, look at the official documentation . It's not there. As such, it's not part of the public API, and you should not call it. Even if it's

Get Wi-Fi protocol (802.11a/b/g/n) programmatically

…衆ロ難τιáo~ 提交于 2019-12-01 15:00:58
Through WifiManager, my Android app can get a lot of details about Wi-Fi. However I fail to get protocol type like a/b/g/n. I have a client requirement to do that. Does anyone know how to achieve that? (I don't have the option to use adb). It is to be done programmatically. I strongly believe that device and router have already negotiated protocol before they can connect. So that information is there with device. Question is, how do we get it? You can partially deduce the protocol from the link speed WifiManager.getConnectionInfo().getLinkSpeed() By Wikipedia 802.11 protocols speed table you

Android using wifimanager to connect to WPA-PSK secured network

爷,独闯天下 提交于 2019-12-01 14:27:53
so I have trawled true all threads in here and any where else where google would take me. But still I am having problems connecting to WPA PSK networks. Here is my code, I have 2 edittext fields from which I read SSID and PSK and then one checkbox to select if SSID is hidden or not. EditText mSSID = (EditText) findViewById(R.id.wifiTVssidcurrent); String networkSSID = mSSID.getText().toString(); EditText mWPA = (EditText) findViewById(R.id.wifiTVwpacurrent); String networkWPA = mWPA.getText().toString(); // Update text to show that connection is pending TextView wifiStatus = (TextView)

Get Wi-Fi protocol (802.11a/b/g/n) programmatically

笑着哭i 提交于 2019-12-01 13:50:45
问题 Through WifiManager, my Android app can get a lot of details about Wi-Fi. However I fail to get protocol type like a/b/g/n. I have a client requirement to do that. Does anyone know how to achieve that? (I don't have the option to use adb). It is to be done programmatically. I strongly believe that device and router have already negotiated protocol before they can connect. So that information is there with device. Question is, how do we get it? 回答1: You can partially deduce the protocol from

WiFi Direct status

怎甘沉沦 提交于 2019-12-01 13:06:55
问题 Is it possible to specifically check that whether WiFi Direct is On or Off ? I wrote a code which can only update about the wifi status that whether it is connected or not,no matter it is Access point or WiFi Direct ConnectivityManager connManager = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (mWifi.isConnected()) { } if (!mWifi.isConnected()) { } I want to specifically