Questions tagged [android-wifi]

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

2111 questions
45
votes
5 answers

SCAN_RESULTS_AVAILABLE_ACTION return empty list in Android 6.0

Yesterday my Nexus 5 receive the update from Android MNC to version 6.0 - Marshmallow. Since then, the action to scan the networks available in the device stop receiving the list, in this case the result list have a size of 0, even with 10+ Wifi…
Deividi Cavarzan
  • 10,034
  • 13
  • 66
  • 80
38
votes
4 answers

How to mock Context using Mockito?

I'm using Context to access system level services like WifiManager and BluetoothManager. How to mock this getApplicationContext() using Mockito?
user3600801
38
votes
4 answers

How to get available wifi networks and display them in a list in android

Friends, I want to find all available WiFi networks and display them in a list I have tried as below. But it's not working. I have edited my code, and now I got the result but with all the result that I don't need. I only need names of wifi network…
jigar
  • 1,571
  • 6
  • 23
  • 46
37
votes
2 answers

Send request over Mobile data when WIFI is ON.(Android L)

SDK: Android 5.0.1. Android build: LRX22C. Device : Nexus 5. Problem: KITKAT(4.4.4) and below API's 1) startUsingNetworkFeature(int networkType, String feature) This method is deprecated. Deprecated in favor of the cleaner…
NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
35
votes
4 answers

Best way to evaluate connection speed

I'm developing an app which needs to get music file by streaming for playing live. In the request song api I can specify the bandwith (eg: 50kbps, 100kbps, 300, 600 or 1 Mbps). The more the bandwith is big, the more the file will get time to be…
GrandMarquis
  • 1,913
  • 1
  • 18
  • 30
34
votes
6 answers

How to enable/disable WiFi from an application?

I want to enable/disable wifi from my Android application. How can I do that?
Mustafa İrer
  • 1,051
  • 5
  • 15
  • 29
34
votes
5 answers

How to avoid delay in Android GCM messages / change heartbeat

I've been reading many posts regarding a GCM issue that affects some people. It seems that in some devices/routers/carriers the notifications suffer delays. I've experienced this issue with my router: messages came with a lot of delay on WIFI but…
31
votes
5 answers

How can I get Android Wifi Scan Results into a list?

I know how to get a of Android Wifi Scans but I can not figure out the best way to make a list adapter out of them. I would like to just bind SSID and BSSID from a of scans to text1 and text2. Samples of what I have been doing…
Seth Hikari
  • 2,711
  • 6
  • 27
  • 32
31
votes
1 answer

Change WiFi hotspot's SSID and password in Android Oreo 8.x

In my Android application I'm using the following code snippet: @RequiresApi(api = Build.VERSION_CODES.O) private void turnOnHotspot(){ WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); …
Markinson
  • 2,077
  • 4
  • 28
  • 56
31
votes
5 answers

Share Wifi credentials via NFC tag without special apps

I am looking for a way to create a NFC-tag that shares the wifi credentials of my network without my guests having to have any special NFC apps on their phone (other than whats coming with the phone). I have been looking at apps and services like…
Christian L
  • 357
  • 1
  • 4
  • 5
30
votes
7 answers

how to install CA certificate programmatically on Android without user interaction

I'm trying to install certificates without prompting the user. I know this is not good practice, but that's what PM wants. Using KeyChain.createInstallIntent(), I can get Android to launch the certificate installation dialog by calling…
Pedro
  • 443
  • 1
  • 4
  • 7
29
votes
6 answers

How to forget a wireless network in android programmatically?

I am working on an app which wifi , where user will be asked to enter password for the scanned network he selects, if user enters a correct password, it connects and works well. But when user enters wrong password, a new network is added with that…
Adarsh H S
  • 1,208
  • 6
  • 21
  • 42
27
votes
14 answers

android adb turn on wifi via adb

My phone has been locked (too many pattern attempts). To unlock I need to enter username and password on my gmail account. This is the only way I can unlock it. I cant launch any activities, even to turn on wifi connection. Without internet…
pleerock
  • 18,322
  • 16
  • 103
  • 128
26
votes
4 answers

how to run wifi peer to peer application in android emulator..?

I am trying to develop an wifi peer to peer application in android(4.+). The problem here is how to test it. I tried to run that application in android emulator. there was no option to configure wifi in the settings menu, i also tired to enable wifi…
mani
  • 1,012
  • 7
  • 26
  • 47
26
votes
4 answers

How to handle network change between wifi and mobile data?

I am building a VoIP app.During a VoIP call when user switches between WiFi to mobile data i have a problem handling the scenario. In my call screen activity I have registered for receiver which helps me get notified about the network change…