Questions tagged [android-wifi]

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

2111 questions
13
votes
3 answers

Can I turn on WiFi-Direct from code? on Android API-14 (ICS)

I'm using the new Wi-Fi Direct API from google on Android 4.0 and in Sample code they send the User to Settings, to activate WiFi -Direct Mode. Is there a way to Start it by code??? all they offer is to listen to WIFI_P2P_STATE_CHANGED_ACTION…
zaxy78
  • 1,406
  • 3
  • 19
  • 32
13
votes
4 answers

Oreo Wifi Connectivity

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…
Digital Da
  • 891
  • 1
  • 10
  • 23
13
votes
1 answer

Connect to wifi without internet programmatically

I'm using the following code to connect to a WiFi network without internet connection, because it hosts its own web-server where I want to connect even if there is no internet connection available. WifiConfiguration wifiConfiguration = new…
ForJ9
  • 735
  • 8
  • 24
13
votes
1 answer

Android JobScheduler running way too often when using setPeriodic()

I noticed my scheduled JobScheduler is executing the job way too often. I have it set to execute daily and it requires to be idle, to be on wlan and to be charging, but when those conditions are met the job executes like every 10min or even more…
qwertz
  • 6,206
  • 9
  • 40
  • 62
13
votes
2 answers

Android: Turn On/Off WiFi Hotspot Programmatically on Android Marshmallow (6.0)

I have come across this thread (Android: How to Enable/Disable Wifi or Internet Connection Programmatically) which is very similar to what I wanted to ask. I have tried the solution provided by an answer posted by Ashish Sahu…
13
votes
4 answers

Why my access from my mobile to my computer network doesn't work?

I have a problem and it is that, yesterday, I could access from my mobile phone to my computer network but today it doesn't work. Why it could be? What I have ready: I have running my local server with XAMPP (I have started Apache and MySQL). I'm…
Francisco Romero
  • 12,787
  • 22
  • 92
  • 167
13
votes
1 answer

Captive portal without internet on Android

Good day. I need Captive Portal on the WiFi hotspot that will work without internet and popup a notification or open a login page automatically. I am using Mikrotik with RouterOS 6.27. I created hotspot and then added a RegExp in DNS like .* =…
Taras
  • 391
  • 4
  • 10
13
votes
5 answers

WifiConfiguration enable network in Lollipop

I was working on Wifi project, there is a module that enable user to join wifi programatically. In kitkat and below it's working successfully, but in Lollipop it's not working. Here is the code : WifiManager wifiManager = (WifiManager)…
vintry
  • 301
  • 3
  • 9
13
votes
7 answers

Get Android WiFi "net.hostname" from code

When an Android device connects to a wifi AP, it identifies itself with a name like: android_cc1dec12345e6054 How can that string be obtained from within an Android app? Not for the purpose of changing it, just for readout. EDIT: This is a…
TheGraeme
  • 1,073
  • 1
  • 9
  • 10
13
votes
2 answers

How to find wifi and network data usage separately by particular application in android?

recived = TrafficStats.getUidRxBytes(uid); send = TrafficStats.getUidTxBytes(uid); TrafficStats.getMobileRxBytes(); TrafficStats.getMobileTxBytes(); TrafficStats.getTotalRxBytes(); TrafficStats.getTotalTxBytes(); i have application id and i can…
Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
13
votes
2 answers

Android Wi-Fi Direct read rssi signal strength

I need to measure Wi-Fi Direct signal(RSSI signal) between two Android mobile phones. How i can do that?
userInThisWorld
  • 1,361
  • 4
  • 18
  • 35
13
votes
3 answers

How to get BSSID of all wifi access points?

I need to get BSSID(MAC) of all AP's. Please find below code block. List test = wifiManager.getConfiguredNetworks(); for(int k=0;k
Balaji Khadake
  • 3,449
  • 4
  • 24
  • 38
13
votes
2 answers

Simulate Slow Internet Connection on a REAL device?

I need to test my application in conditions where even 2G Internet connectivity isn't at its full coverage (i.e. 2 bars instead of 4, 2G). I prefer conducting these tests over WiFi. Is there a way (programmatically or otherwise) to tell the Android…
scatmoi
  • 1,958
  • 4
  • 18
  • 32
12
votes
2 answers

android turning on wifi programmatically

I am trying to turn add a wifi network programmatically and to connect to that network. My code works fine if the wi-fi is already turned on. If wi-fi is off, what i see wifimanager.addtonetwork() fails and when i see the wifi settings for the…
png
  • 4,368
  • 7
  • 69
  • 118
12
votes
3 answers

Android link to wireless & Network Settings

Hi I'm making an App that checks internet connection, if it's not connected it goes to an activity that has an error message and a button that I want to link to the wireless and network settings. But I'm not sure how to do it, can anyone help me…
iamlukeyb
  • 6,487
  • 12
  • 29
  • 40