Link to home
Start Free TrialLog in
Avatar of Wayne88
Wayne88Flag for Canada

asked on

WiFi scanning in Android programming (specify channel and active/passive)

Need help with a WORKING code examples for the following:

Active/Passive Wi-Fi scanning
Scan only specific Wi-Fi channel.  For example, when instead of scanning all 11 channels what if I only want to scan for all access points using channel 5?

Thanks in advance
Avatar of Molnár István
Molnár István
Flag of Romania image

mWifiManager.startScanActive() and mWifiManager.startScan():
-Passive scanning listens to beacons sent by the access points. That means waiting for the beacon to be sent (usually a few seconds).
-An active scanning will emit probes to those APs immediately.
[ref: http://stackoverflow.com/questions/5958715/what-is-the-difference-between-active-scan-and-passive-scan]

see also: http://developer.android.com/reference/android/net/wifi/WifiManager.html

hope it helps
You didn't really specify what language or IDE you're using, which would help if you want working code samples.
Avatar of Wayne88

ASKER

Hi Guys, sorry for the late reply.  Was having computer issues and haven't got a chance to code.  I am using Eclipse SDK.  Thank you.

Thanks Molnar, I will test as soon as I can get the laptop back running.
The links supplied are both for Java, if I'm not mistaken.

The only Eclipse IDE that I know of uses C/C++... so you might want to ask the administrators to add the C++ topic area for you. (i.e. click the Request Attention link under your original question.)
Avatar of Wayne88

ASKER

Hi Guys, finally got the pc running and Eclipse reinstalled.  I have read the link Molnar supplied before and I've tried it again.  The problem is that Eclipse wouldn't compile mywifi.startScanActive() because the method is not part of the SDK.  This is where I got stuck and Google is not producing much help.

http://stackoverflow.com/questions/6234728/missing-method-in-android-net-wifi-wifimanager
ASKER CERTIFIED SOLUTION
Avatar of Wayne88
Wayne88
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wayne88

ASKER

Also, the phone must be rooted which is not practical.
Avatar of Wayne88

ASKER

Can't be done using Eclipse SDK