android-wifi

Wifi Direct Group Owner Address

橙三吉。 提交于 2021-02-10 19:57:13
问题 That's an easy question, I've to get the "Group Owner address" using "Wifi direct", I know that this is in WifiP2pInfo.GroupOwnerAddress, but how can I initialize WifiP2pInfo.groupOnwerAddress to get the Group Owner address in my application? Could someone give me a pass to pass? I'm new in android and java. Many Thanks. 回答1: NetworkInfo networkInfo = (NetworkInfo)intent.getParcelableExtra(extraKey); if (networkInfo.isConnected()) { wifiP2pManager.requestConnectionInfo(wifiDirectChannel, new

Wifi Direct Group Owner Address

妖精的绣舞 提交于 2021-02-10 19:56:41
问题 That's an easy question, I've to get the "Group Owner address" using "Wifi direct", I know that this is in WifiP2pInfo.GroupOwnerAddress, but how can I initialize WifiP2pInfo.groupOnwerAddress to get the Group Owner address in my application? Could someone give me a pass to pass? I'm new in android and java. Many Thanks. 回答1: NetworkInfo networkInfo = (NetworkInfo)intent.getParcelableExtra(extraKey); if (networkInfo.isConnected()) { wifiP2pManager.requestConnectionInfo(wifiDirectChannel, new

WiFi enabled device recognize WiFi access points?

时间秒杀一切 提交于 2021-02-08 10:40:18
问题 How does WiFi enabled device recognize WiFi access points in programming language? 回答1: from: http://www.androidsnippets.com/scan-for-wireless-networks package com.android.wifitester; import java.util.List; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; import android.os.Bundle; import android.view

Connect to Wifi programmatically not working for Android Marshmallow?

依然范特西╮ 提交于 2021-02-08 09:22:05
问题 String BACKSLASH = "\""; String NETWROK_SECURITY_WEP = "WEP"; String NETWROK_SECURITY_NONE = "NONE"; String NETWROK_SECURITY_WPA = "WPA"; String NETWROK_SECURITY_WPA2 = "WPA2"; String NETWROK_SECURITY_WPA_WPA2 = "WPA/WPA2 PSK"; String NETWROK_ADDITIONAL_SECURITY_TKIP = "TKIP"; String NETWROK_ADDITIONAL_SECURITY_AES = "AES"; String NETWROK_ADDITIONAL_SECURITY_WEP = "WEP"; String NETWROK_ADDITIONAL_SECURITY_NONE = "NONE"; int FAILED_TO_ADD_NETWORK = -1; WifiConfiguration conf = new

Connect to wifi network Android programmatically

℡╲_俬逩灬. 提交于 2021-02-08 06:14:28
问题 I am trying to connect to selected wifi network(from UI) but I am unable to connect to it. Here is my code: private boolean addNetworkAndActivate(ScanResult scanResult, String password) { WifiConfiguration wc = null; List<WifiConfiguration> configs = mainWifi.getConfiguredNetworks(); for (WifiConfiguration wifiConfiguration : configs) { try { if (wifiConfiguration.SSID.equals("\"" + scanResult.SSID + "\"")) { wc = wifiConfiguration; break; } } catch (Exception e) { } } // not configured,

Connect to wifi network Android programmatically

与世无争的帅哥 提交于 2021-02-08 06:14:19
问题 I am trying to connect to selected wifi network(from UI) but I am unable to connect to it. Here is my code: private boolean addNetworkAndActivate(ScanResult scanResult, String password) { WifiConfiguration wc = null; List<WifiConfiguration> configs = mainWifi.getConfiguredNetworks(); for (WifiConfiguration wifiConfiguration : configs) { try { if (wifiConfiguration.SSID.equals("\"" + scanResult.SSID + "\"")) { wc = wifiConfiguration; break; } } catch (Exception e) { } } // not configured,

Connect to wifi network Android programmatically

强颜欢笑 提交于 2021-02-08 06:13:15
问题 I am trying to connect to selected wifi network(from UI) but I am unable to connect to it. Here is my code: private boolean addNetworkAndActivate(ScanResult scanResult, String password) { WifiConfiguration wc = null; List<WifiConfiguration> configs = mainWifi.getConfiguredNetworks(); for (WifiConfiguration wifiConfiguration : configs) { try { if (wifiConfiguration.SSID.equals("\"" + scanResult.SSID + "\"")) { wc = wifiConfiguration; break; } } catch (Exception e) { } } // not configured,

Android Q always reusing the first entered credentials to connect to the WiFi network

♀尐吖头ヾ 提交于 2021-02-04 07:00:48
问题 I am trying to connect to WiFi using the WifiNetworkSpecifier on Android Q. The problem which I run into is Android always using the last valid credentials to connect to the AP, even after I manually provide the new, updated credentials to the WifiNetworkSpecifier. This is the flow: Successfully connect to the AP. Change the password of the WiFi network. Run the app, try to connect again with the updated credentials (new, valid password provided) but the app can't connect to the WiFi

Bind all client sockets to wifi interface

拜拜、爱过 提交于 2021-01-29 07:45:14
问题 I'm writing a client application for my action camera. There's an issue using network connections when smartphone connected to wifi and mobile network: Android determines, that wifi does not connected to internet, so all requests passed to mobile network interface. I've already implemented the client API, that uses pre-bounded sockets to communicate with camera: public class MainActivity extends AppCompatActivity { private Network wifi; @Override protected void onCreate(Bundle

Getting the MAC addresses of in-range WiFi networks

三世轮回 提交于 2021-01-28 21:08:05
问题 Is it possible to retrieve the MAC addresses of all available WiFi networks? I know you can do it for the network you're currently connected to: WifiManager wifiMan = (WifiManager) this.getSystemService( Context.WIFI_SERVICE); WifiInfo wifiInf = wifiMan.getConnectionInfo(); String macAddr = wifiInf.getMacAddress(); But is it also possible for networks you're not connected to? Edit: Is it at all possible under the OSI model (http://en.wikipedia.org/wiki/OSI_model) ? It seems like the MAC