Questions tagged [android-wifi]

This tag is related to Wifi related questions on Android mobile devices

2111 questions
25
votes
4 answers

android: Determine security type of wifi networks in range (without connecting to them)

I can enumerate all wifi networks in range (using startScan + SCAN_RESULTS_AVAILABLE_ACTION + getScanResults) and get their SSID and BSSID values, but I can't figure out how to determine the security type of each network. In my main object: …
Aidan64
  • 573
  • 1
  • 5
  • 12
25
votes
8 answers

Connect to Wifi in Android Q programmatically

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…
NizarETH
  • 969
  • 3
  • 15
  • 38
25
votes
4 answers

Can I find the MAC address of my Access point in Android?

Can my Android app find the MAC address of the Wifi access point it is connected to? The docs for android.net.wifi.WifiInfo getMacAddress() don't provide any details. See…
Michael Levy
  • 13,097
  • 15
  • 66
  • 100
25
votes
2 answers

Internet check over android.net.NetworkCapabilities not working

I have a question about android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET. According to the JavaDocs this "indicates that this network should be able to reach the internet". Unfortunately this seems not to work properly - or I do something…
Timo Bähr
  • 1,826
  • 2
  • 22
  • 26
25
votes
3 answers

Android 5.0 Lollipop and 4.4 KitKat ignores my WiFi network, enableNetwork() is useless

My app connect directly to a hardware device that act as an access point (with no access to internet). I can't connect because Android 5.0 automaticcaly switch to a valid internet connection, so if I have data connection (3G, 4G, ...) or a…
Seraphim's
  • 12,559
  • 20
  • 88
  • 129
25
votes
5 answers

Jelly Bean Issue - wifiManager.getConnectionInfo().getSSID() - extra ""

Hi all bug reporting for your information. link Problem details: The Code - wifiManager.getConnectionInfo().getSSID() The above code to returns the current SSID, it is returning the current SSID with extra quotations around it. For eg. the SSID…
Aiden Fry
  • 1,672
  • 3
  • 21
  • 45
24
votes
4 answers

Setting WiFi priority on Android Lollipop or later via Settings UI

KitKat had the Settings > WiFi > Advanced WiFi option to set the priority as shown. This isn't present on my Nexus Lollipop and Marshmallow devices. I see there is an App available, but I'd like to know if there is some onboard way I missed to…
Carl Whalley
  • 3,011
  • 8
  • 33
  • 48
24
votes
6 answers

Android get IP-Address of a hotspot providing device

I'm currently using public static String getLocalIPAddress(WifiManager wm){ return Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress()); } to get the IP-Address of the executing devices. That works fine if the device is connected…
user2224350
  • 2,262
  • 5
  • 28
  • 54
23
votes
5 answers

Android Q, programmatically connect to different WiFi AP for internet

As in Android Q, several WiFi APIs are restricted. I am trying to use alternate APIs to connect to different Wifi AP for internet. Below is my code : WifiNetworkSpecifier.Builder builder = new WifiNetworkSpecifier.Builder(); …
23
votes
5 answers

Android WifiManager.addNetwork() returns -1

I am writing an android app which will connect to a specific WPA access point, when connected, it will issue a http call. It will not save the network config. I have read almost every post on stack overflow on connecting to wifi network but can't…
Mukesh Aggarwal
  • 241
  • 1
  • 2
  • 5
22
votes
2 answers

Send request over WiFi (without connection) even if Mobile data is ON (with connection) on Android M

I have to send UDP packets to a WiFi module (provided with own AP) with no internet connection but when I connect the mobile with the AP, Android redirects my packets on the mobile data interface because it has got internet connection. I've used the…
22
votes
6 answers

Android adb wireless/WIFI debug Operation timed out

I followed steps in this post and tried to connect to my Motorola X Gen 2 for Wifi debugging, on OS X El Cap. I connected my phone to the laptop with usb cable, I killed and started server, the server was started successfully, and then in: ./adb…
TPWang
  • 1,322
  • 4
  • 20
  • 39
22
votes
2 answers

How the "SHAREit" android application works technically?

I want to build a data sharing application on android using wi-fi like "SHAREit" but I did not get where I start from. So if any clear me the technical concept of "SHAREit" it was very much efficient to understand. When we want to send a file we…
Rashed Shaon
  • 348
  • 2
  • 4
  • 17
21
votes
4 answers

Connect two android phones with wi-fi (without laptop or access point) and send file

Is it possible to connect two android phones by wi-fi, without using a bluetooth/GSM/CDMA/IR? Also, there is no any laptop or wi-fi access points or wi-fi routers. I think, that it is possible to create some SSID on both phones, do a static…
osgx
  • 90,338
  • 53
  • 357
  • 513
21
votes
3 answers

How to turn on/off wifi hotspot programmatically in Android 8.0 (Oreo)

I know how to turn on/off wifi hot spot using reflection in android using below method. private static boolean changeWifiHotspotState(Context context,boolean enable) { try { WifiManager manager = (WifiManager)…
Chandrakanth
  • 3,711
  • 2
  • 18
  • 31