wifimanager

Connecting to WiFi network automatically in Android 5 and 6

限于喜欢 提交于 2019-12-01 10:56:02
Been struggling with connecting to WiFi network in Android 5 and 6 for a while and other similar questions don't seem to work for me. I could get the same code working in Android 4.4.2 Adding the code snippet below. String networkSSID = getSsid(); String networkPass = getNetworkPass(); WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; conf.status = WifiConfiguration.Status.ENABLED; conf.priority = 40; conf.allowedProtocols.set(WifiConfiguration.Protocol.RSN); conf.allowedProtocols.set(WifiConfiguration.Protocol.WPA); conf.allowedKeyManagement.set

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

北城以北 提交于 2019-12-01 07:28:58
问题 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) ? 回答1: 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

wifi search for the devices connected to the same network i.e other than acces point(for android)

纵然是瞬间 提交于 2019-11-30 16:56:13
i want to make a modification to my project and right now the project status is..... it is searches the available WiFi networks and shows the list with info of the network this works properly.Now i want to search and see the details of the devices connected to the network. Is there any way to find these devices ? Your comment will be useful for me, Thanks. Would you like to discover a specific device ? Or you need the list of all connected devices? The second I don't think is possible. EDIT Discovering specific devices: Using UDP Broadcast . Some reference can be found here ! There are some

Is there any way to get notified when known SSIS wifi networks get in/out of range?

南楼画角 提交于 2019-11-30 13:15:48
问题 I want to write an application which consists on perform actions when a known wifi networks get in or out of range. For example, let's say my home wifi network's SSIS is "WifiHome", and i want to make a notification "You just left home!" whenever the device can't detect this specific network anymore. (Or alternativly - "You just entered home" when the device re-detect signals from this network). My question is: Is is possible to listen to those changes without polling the available-network

how to enumerate all available Wifi networks at range?

空扰寡人 提交于 2019-11-30 07:42:35
问题 I read on google that this is not possible, and that on OS 2.0, it was some undocumented Api to accomplish that, but then your app will got rejected .... we are almosto on OS 4.0....any news regarding this? 回答1: There are pre-2.0 solutions to be found on the Internet. One of them seems to be as follows: void *libHandle; void *airportHandle; int (*open)(void *); int (*bind)(void *, NSString *); int (*close)(void *); libHandle = dlopen("/System/Library/Frameworks/Preferences.framework

Issue with WifiManager.calculateSignalLevel(RSSI, 5)

*爱你&永不变心* 提交于 2019-11-30 07:41:28
I am trying to use the Wifimanager to calculate the Signal Level of the access points found during a scan. I am using the following method: WifiManager.calculateSignalLevel(int, int) But it appears to always return the same int no matter what the RSSI level is. Here is my code: public int calculateQoS(int aRSSI){ signalLevel = WifiManager.calculateSignalLevel(RSSI, 5); return signalLevel; } public void testCalculateQoS(){ Log.d("signal", "signal = : " + connMonitor.calculateQoS(-44) + " " + connMonitor.calculateQoS(-80) + " " + connMonitor.calculateQoS(-120) + " " + connMonitor.calculateQoS(

What interval should I use between each WiFi scan on Android?

∥☆過路亽.° 提交于 2019-11-30 07:38:15
I need to perform Wifi scans at regular intervals. I am encountering a problem when the time interval is set to 1-2 seconds. It seems like I am not getting any ScanResult . Is there a minimum amount of time to set so that the WifiManager is able to perform a successful WiFi scan? Here is the code. I am using a Service to do the Wifi scan: public class WifiScanning extends Service{ private static final String TAG = "WifiScanning"; private Timer timer; public int refreshRate, numberOfWifiScan, wifiScanGranularity; WifiReceiver receiverWifi = new WifiReceiver(); WifiManager wifi; StringBuilder sb

Getting the MAC address of the device- when wifi is off

試著忘記壹切 提交于 2019-11-30 07:26:40
I am finding the MAC address of the Android Device using the following code: WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = manager.getConnectionInfo(); String address = info.getMacAddress()); But in this case I am unable to get the MAC address when the Wifi is off. How can I get the MAC address of the Android Device even when WIFI is off. Thanks Siddharth Lele Why not enable the Wifi momentarily until you get the MAC address and then disable it once you are done getting the MAC address? Of course, doing this is if getting the MAC address is

Android Wifi Scan - BroadcastReceiver for SCAN_RESULTS_AVAILABLE_ACTION not getting called

萝らか妹 提交于 2019-11-29 15:20:59
问题 Here is my code: public class FloatWifiManager implements IWifiManager { private WifiManager wifiManager; private BroadcastReceiver wifiScanReceiver; public FloatWifiManager(Context context) { ... wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); // Registering Wifi Receiver wifiScanReceiver = new BroadcastReceiver() { @Override public void onReceive(Context c, Intent intent) { if (intent.getAction().equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) { // not getting

Getting the MAC address of the device- when wifi is off

微笑、不失礼 提交于 2019-11-29 09:33:30
问题 I am finding the MAC address of the Android Device using the following code: WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = manager.getConnectionInfo(); String address = info.getMacAddress()); But in this case I am unable to get the MAC address when the Wifi is off. How can I get the MAC address of the Android Device even when WIFI is off. Thanks 回答1: Why not enable the Wifi momentarily until you get the MAC address and then disable it once you are