android-wifi

Getting the MAC addresses of in-range WiFi networks

一世执手 提交于 2021-01-28 20:32:49
问题 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

BindProcessToNetwork not working on a specific device

微笑、不失礼 提交于 2021-01-28 05:07:13
问题 I have an app that's custom built for a client and not available in the Play Store that basically makes some network calls when it detects that the device is connected to their WiFi. This should happen even if it has no internet connection, every request that the app makes is to a local address. The problem comes with the new batch of tablets that the client has purchased (Galaxy Tab Active 2, Android 8.1.0, Build number M1AJQ.T395XXU3BRJ5), which will always prefer a connection with internet

Is there a way to programmatically connect to a Passpoint/Hotspot2.0 network via EAP-TTLS?

大憨熊 提交于 2021-01-27 17:42:35
问题 I'm trying to create either a WifiConfiguration object or PasspointConfiguration object in my Android application that will allow me to connect a device to a Passpoint network upon being enabled. I've tried to connect by building a WifiConfiguration object and adding it to the WifiManager, then enabling it. I have also tried to build a PasspointConfiguration object, but when I try to run WifiManager.addOrUpdatePasspointConfiguration() with the PasspointConfiguration object, the app crashes

Connect To Wifi Android Q

混江龙づ霸主 提交于 2020-12-29 07:36:51
问题 I'm trying to connect to wifi with below code val specifier = WifiNetworkSpecifier.Builder() .setSsid(machineID).build() val networkRequest = NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) .setNetworkSpecifier(specifier) .build() val connectivityManager = context.applicationContext .getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? connectivityManager?.requestNetwork(networkRequest,object:ConnectivityManager.NetworkCallback(){ override fun

Connect To Wifi Android Q

余生长醉 提交于 2020-12-29 07:35:46
问题 I'm trying to connect to wifi with below code val specifier = WifiNetworkSpecifier.Builder() .setSsid(machineID).build() val networkRequest = NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) .setNetworkSpecifier(specifier) .build() val connectivityManager = context.applicationContext .getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? connectivityManager?.requestNetwork(networkRequest,object:ConnectivityManager.NetworkCallback(){ override fun

Android API to Connect to Wifi Network

戏子无情 提交于 2020-12-15 05:49:47
问题 I'm totaly lost in the versions of WiFi APIs. I want to connect to a configured WiFi Network programmaticaly. As decribed in this question: Connect to wifi network Android programmatically I develop on Android 10 and want to write a code that is also compatible with older Android Versions. On my android 10 the code described does not work. What code do I need to implement the functionality on Android 10? What do I do to write an application that also runs on my other Android 9 phone? Regards

Connect to Wifi in Android Q programmatically

谁都会走 提交于 2020-12-05 07:01:05
问题 I had this function to connect in Wifi network, below Android 10 it works fine, but when I tried on Android 10, I had a successful connection but WITHOUT internet , I knew it's a bug in Android 10 but I found this application which can connect to wifi from Android 10 with no problem. I'm blocked for days. My function : private void connectToWifi(String ssid, String password) { WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); if (Build.VERSION.SDK_INT < Build.VERSION