Solved

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

Posted on 2014-11-25
8
812 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
  • 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 13

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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 13

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 13

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 13

Author Comment

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

Author Closing Comment

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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
Introduction Everyone is using a smartphone these days. Contacts, messages, applications, documents, bookmarks, pictures, videos and other stuff which you created and are present only on your device come under the umbrella called “Personal Data”.…
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
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.

744 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

14 Experts available now in Live!

Get 1:1 Help Now