Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scan for Wi-Fi access points on Android while in hotspot mode

Tags:

android

wifi

I have a question concerning WiFi scanning and AccessPoint mode on Android.

The first thing I noticed when playing around with setting up an access point is that WiFi "turns off" (clearly, WiFi must be turned on in some way, but I guess "off" refers to the fact that we cannot connect to another access point).

My question is: why can't I scan for access points on Android while in access point mode? Apparently, it has nothing to do with the WiFi standard because it works on my Ubuntu laptop - when I activate hotspot mode and create a hotspot with another device after that, I can still scan and see the new access point.

To be more specific: If WifiManager.isWifiEnabled() is true, WifiManager.startScan() returns true and will deliver scan results. However, if my phone acts as an access point, isWifiEnabled() returns false and so does startScan(). I would love to see available access points while in hotspot mode.

I don't see why it shouldn't be possible for a WiFi chipset to scan for access points while acting as an access point and I would be grateful for some clarification.

Thank you very much, Micha.

like image 497
nhcham Avatar asked Nov 12 '22 02:11

nhcham


1 Answers

Have you tried doing a WifiManager.startScan(), and does it return false? It's not clear that you have.

As far as your question is concerned, I don't know the answer. But I do know that not every WiFi chipset supports both scanning while also being an access point for other devices. Maybe it's easier to just disable the functionality in software rather than have to know if the chipset supports it (this is assuming that the functionality really is not there, I guess we'll find out when you try it!)

like image 73
Wild Pete Avatar answered Nov 14 '22 23:11

Wild Pete