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

Posted on 2014-11-25
Last Modified: 2014-12-10
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
Question by:Wayne88
  • 5
  • 2
LVL 13

Expert Comment

by:Molnar István
ID: 40466340
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.

see also:

hope it helps
LVL 44

Expert Comment

ID: 40466406
You didn't really specify what language or IDE you're using, which would help if you want working code samples.
LVL 14

Author Comment

ID: 40469653
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.
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

LVL 44

Expert Comment

ID: 40469986
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.)
LVL 14

Author Comment

ID: 40479305
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.
LVL 14

Accepted Solution

Wayne88 earned 0 total points
ID: 40483395
After researching this issue further it seems as:

Active/Passive Wi-Fi scanning and single channel scanning is not part of the Android Eclipse SDK and there are hacks you can do to sideload IW from Linux but this is not an official solution.
LVL 14

Author Comment

ID: 40483398
Also, the phone must be rooted which is not practical.
LVL 14

Author Closing Comment

ID: 40490919
Can't be done using Eclipse SDK

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bunnyEars2 challenge 6 128
Samsung Marshmallow  - how to get rid of annoying alarm icon. 2 102
Auto-rotate google map 1 83
Samsung S5 - Bricked?? 5 44
I recently asked a question ( about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to:…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now