Solved

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

Posted on 2014-11-25
8
920 Views
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
0
Comment
Question by:Wayne88
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
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.
[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
0
 
LVL 44

Expert Comment

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

Author Comment

by:Wayne88
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.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 44

Expert Comment

by:Darr247
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.)
0
 
LVL 14

Author Comment

by:Wayne88
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.

http://stackoverflow.com/questions/6234728/missing-method-in-android-net-wifi-wifimanager
0
 
LVL 14

Accepted Solution

by:
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.
0
 
LVL 14

Author Comment

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

Author Closing Comment

by:Wayne88
ID: 40490919
Can't be done using Eclipse SDK
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Here, we have shared an easy step by step tutorial on how to download instagram images and videos on PC, Android Mobile and iOS mobile.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
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: http://www.codetwo.com/excha…

749 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