This tag is related to Wifi related questions on Android mobile devices
Questions tagged [android-wifi]
2111 questions
21
votes
2 answers
Get the current speed of internet (mobile & Wifi) using Android
I have an app that has to work in offline and online mode. Application has to make requests to the app server based on the internet speed of the current network connection (Wifi or Data).
If Wifi is connected, I can get the Wifi signal strength of…

user198530
- 331
- 1
- 3
- 10
20
votes
9 answers
Can I have both Wi-Fi and cellular network interfaces open at the same time on Android?
I'm working on an application that will run on a phone where the phone
will be a station on a private Wi-Fi network. The phone will be a
station, not an access point, and the private Wi-Fi network does not
route to the Internet. My application…

digiGuy
- 201
- 1
- 2
- 3
20
votes
4 answers
Connect android to two wireless networks simultaneously
I want to make my android connects two networks at the same time, the first one a wifi network to get internet connection and the other one ad-hoc network ( a network between mobiles to share some data), but the android can join only one network at…

alex CSD
- 405
- 2
- 4
- 11
20
votes
6 answers
How to get each device's IP address in Wi-Fi Direct scenario?
Starting from ICS, Wi-Fi Direct is introduced. Normally, we use the WifiP2pManager class to operate on Wi-Fi Direct, but it seems that it can only retrieve the GroupOwner IP address after connected. But, actually, any device all came negotiate to…

nicefuture
- 257
- 1
- 5
- 8
19
votes
2 answers
Android 7.0 (Nougat) Doze Mode Stops Web Service
I have an Android foreground service with a WiFi lock that acts as a web service for another local device. Before Doze mode, acquiring a WiFi lock and being a service as needed worked great.
Even with battery optimizations turned off for my app, the…

Justin
- 3,322
- 2
- 22
- 37
19
votes
4 answers
How to detect mobile hotspot feature availability in Android programmatically?
I hope title itself says what my question is...
For example, We can check the Wifi availability with PackageManager like
packageManager.hasSystemFeature(PackageManager.FEATURE_WIFI);
Similarly is there any way to detect Mobile hotspot feature…

RuntimeException
- 1,201
- 3
- 14
- 25
19
votes
3 answers
Prevent Android phone from connecting to WiFi network unless my app approves it?
I want to develop an app that can prevent connection to a WiFi network unless I approve it. I want to be able to query the MAC address of the access point and compare that to a list of known addresses corresponding to SSIDs. The goal of the app is…

Duncan Jones
- 67,400
- 29
- 193
- 254
19
votes
2 answers
How to identify an Android device programmatically?
Currently, I am using MAC address as the identifier for an Android device.
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo wInfo = wifiManager.getConnectionInfo();
String mac =…

JackWM
- 10,085
- 22
- 65
- 92
18
votes
7 answers
BroadcastReceiver declared in manifest is not receiving the Broadcast
I've tried to register a Wifi BroadcastReceiver to get the wifi state when it changes. But so far I have no luck receiving the broadcast.

Zul
- 1,344
- 2
- 12
- 21
18
votes
3 answers
Android 2.3 wifi hotspot API
What is the API call I need to make in Android 2.2 (Froyo) to create a Wifi hotspot (as seen in the Tethering and Portable Hotspot settings item).

ericyue
- 646
- 1
- 8
- 20
17
votes
7 answers
how to get the IP of the wifi hotspot in Android?
As the title says... I'm trying to be able to get the IP of the wifi iface when it is configured as hotspot. Ideally, I would like to find something that works for all the phones.
Of course, the WifiManager is useless when it comes to get info from…

sirlion
- 287
- 2
- 4
- 11
17
votes
3 answers
Android 10 / API 29 : how to connect the phone to a configured network?
I am working on an application in which one the user has to follow these steps :
connect the phone to wifi ;
connect the phone to a dedicated hotspot from a connected object.
When the user is connected to the dedicated hotspot of the connected…

rolandl
- 1,769
- 1
- 25
- 48
17
votes
4 answers
Is it possible to add a network configuration on Android Q?
Background
I've noticed that in WifiManager class there is a function called addNetwork, that might be useful if I want to restore or save networks information (network name AKA SSID, together with the password and the type), so that I could also…

android developer
- 114,585
- 152
- 739
- 1,270
17
votes
5 answers
android how to check wifi is connected but no internet connection
android my device connected with wifi but how to if wifi is connected but these is no internet connection
following is my code that i trying to check if no internet connection
public static boolean isConnectedWifi(Context context) {
…

Ganesh Gudghe
- 1,327
- 1
- 17
- 41
17
votes
5 answers
Android Wear Enable ADB Connection Over WiFi TCP/IP
I'm trying to develop an app for Android Wear. In order to test my app on my Moto 360 watch (which has no USB port):
I connected my phone to my computer via USB.
I opened the Android Wear companion app on my phone and enabled "debugging over…

Luke
- 2,187
- 1
- 18
- 29