Ive discovered that several android wifi-apps (WiFi Manager, WiFi Analyzer) shows a channel number of WiFi network additionally to BSSID/SSID etc. But I can't find any info on how they do it. The only thing I know is I can get some wifi frequency. Maybe they determine a channel corresponding to that frequency? Is there a way to detect channel of wifi network in android at all? Of course this info is not a big deal and I can live without it :) but still i'm curious...
According to Radio-Electronics.com, channel number is truly related with frequency.
CHA LOWER CENTER UPPER NUM FREQ FREQ FREQ MHZ MHZ MHZ 1 2401 2412 2423 2 2406 2417 2428 3 2411 2422 2433 4 2416 2427 2438 5 2421 2432 2443 6 2426 2437 2448 7 2431 2442 2453 8 2436 2447 2458 9 2441 2452 2463 10 2446 2457 2468 11 2451 2462 2473 12 2456 2467 2478 13 2461 2472 2483 14 2473 2484 2495
For Android, ScanResult contains the frequency of the channel.
@SuppressWarnings("boxing")
private final static ArrayList<Integer> channelsFrequency = new ArrayList<Integer>(
Arrays.asList(0, 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447,
2452, 2457, 2462, 2467, 2472, 2484));
public static Integer getFrequencyFromChannel(int channel) {
return channelsFrequency.get(channel);
}
public static int getChannelFromFrequency(int frequency) {
return channelsFrequency.indexOf(Integer.valueOf(frequency));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With