wifimanager

Scanning for wifi signals only in 2.4Ghz band

旧巷老猫 提交于 2019-12-09 12:39:41
问题 I need to scan for available Wi-Fi signals and their strengths. I'm using wifiManager.startScan(); and asynchronous wifiManager.getScanResult(); . On devices without support of 5GHz band it takes about 500ms to get the results, on devices with 5GHz band support it takes about 2s, and that is too much for me. I guess the 1.5s delay is in searching the whole 5GHz band. Is there any way I could tell the device to scan only in the 2.4GHz band, or any other way I could get the results faster (for

Oreo Wifi Connectivity

半城伤御伤魂 提交于 2019-12-09 05:47:36
问题 I am working on an IoT app in which there is an on boarding process where the user connects to an access point, which has not internet connectivity, configure the device and then connects to his home Wifi network. Android 8 devices have been causing some problems, disconnecting from the access point and reconnecting to a previously configured network. I am assuming this is related to the connectivity update which was introduced in Android 8, from section Seamless Connectivity in this link: On

How to get IP adress of other hosts in same wifi network in android?

左心房为你撑大大i 提交于 2019-12-08 12:25:04
问题 I am using wifi printer from my android application to print any file. Now i am able to send file to printer if i have IP address of printer.But i am having my device's IP address only . SO how can i get IP adress of other hosts(devices,PCs) in same wifi network in android ? Can anybody help me ? Thanks in advance. 回答1: You need to implement scanning over the network for obtaining live ip's on your network. For doing this you need to take a ip range and try to ping the ip in a loop. The range

Start new wifi scan after finishing the current scan

旧巷老猫 提交于 2019-12-08 11:22:06
问题 I am trying to make an apps that will store all wifi BSSID and RSS into an SQLite Database. (my SQLite table named "scanres" here is part of my code on my onCreate() : wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); //jgn lupa manifest xml nya kasih permission!!! if (wifi.isWifiEnabled() == false) { wifi.setWifiEnabled(true); } x = new BroadcastReceiver() { @Override public void onReceive(Context c, Intent intent) { results = wifi.getScanResults(); size = results.size(); if (size

how to programmatically determine if android is connected to wifi?

允我心安 提交于 2019-12-07 10:28:05
问题 I'm trying to setup a test for automation on a new android app that I'm developing but having a bit of trouble with one of the apis The problem i'm facing is I want to start the test AFTER wifi has a connection, not when its in the connecting state. I have tried two solutions but had no luck and test seems to start before my android device is fully connected (no x on the wifi bars) wifiManager.setWifiEnabled(state); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); while (wifiInfo.getSSID(

Can I use WiFi to transfer data/messages between two android phones, not connected to a router?

蹲街弑〆低调 提交于 2019-12-07 08:57:10
问题 I'm aware that if two Android phones are connected to a same wifi network, they can implement socket programming to transfer data between them But I actually want to know if you can use wifi as a transfer medium between two Android phones, just like you Bluetooth? 回答1: With Android 2.2+ it is possible to create a WiFi hot-spot on one device so another device can connect. Internet connection on either device is not required. 回答2: What you are looking for is ad-hoc wireless networking, which is

Android WifiManager getScanResult complains Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission although declared permission

荒凉一梦 提交于 2019-12-07 04:14:19
问题 I am developing an App to check Wifi points. I am getting error "java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results" at wifiManager.getScanResults() even though I already declared those permissions. main activity public class MainActivity extends AppCompatActivity { WifiManager wifiManager; String[] wifis; WifiReceiver wifiReceiver; ListView wifiListView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

How to get Port number of wifiNetwork active currently in android

筅森魡賤 提交于 2019-12-06 10:42:32
I have an requirement where i need to supply IP address and Port number of currently Connected Wifi network. I am getting IP address using WifiInfo class having getIpAddress() method. But i am not able to get Port number.. Kindly provide an appropriate solution../ Portnumber of Wlan? You are dooing right by using the WifiManager. There is no WLAN port that's why you can't get the portnumber. 来源: https://stackoverflow.com/questions/14749497/how-to-get-port-number-of-wifinetwork-active-currently-in-android

connect wpa2 enterprise wifi connection programmatically in android

吃可爱长大的小学妹 提交于 2019-12-06 05:20:59
问题 I just tried few codes for wpa2 enterprise connection in android but nothing is connecting i want a right code to connect the right network. right now i have used this answer but i need few clarification because this answer is very old one. here i am attaching some screenshot about connection clarification. In this you can see identity and password WifiConfiguration wifiConfiguration = new WifiConfiguration(); wifiConfiguration.SSID = "\"" + networkSSID + "\""; wifiConfiguration.BSSID = Bssid

Android - Get Notified when a new access point is detected?

China☆狼群 提交于 2019-12-06 01:24:41
Does Android provide a notification of being in vicinity of a new Wifi Network? Whether the device is configured to connect to that wifi network depends on whether the device has the wifi configuration set for that particular wifi network, but is it possible to get notification whenever entering any new wifi network? I saw the WifiManager class but the states inside the class do not seem to achieve what I am trying to do. Any ideas? Use a BroadcastReceiver registered to receive intents with action: WifiManager.NETWORK_STATE_CHANGED_ACTION . In this BroadcastReceiver, you can extract a