4

I spent much time by seaching for solution but without result. So my question is, is there any way how to detect whether device has 5Ghz Wifi or not? It would be nice if it's possible to achieve that. I already analysed WifiManager but didn't find proper method or property.

Thanks in advance.

3 Answers 3

4

As of Android API Level 21, WifiManager has a method called is5GHzBandSupported() that returns true if the adapter supports 5 GHz band.

2
  • how to determine if 5GHz available on devices running API level <21?
    – surlac
    Dec 28, 2015 at 23:44
  • 1
    I suggest using this answer below. It's not perfect, but it might work in your application. Dec 29, 2015 at 18:27
1

I resolved this using below code snip

        WifiManager wifiManager= (WifiManager) mContext.getApplicationContext().getSystemService(WIFI_SERVICE);
        Class cls = Class.forName("android.net.wifi.WifiManager");
        Method method = cls.getMethod("isDualBandSupported");

        Object invoke = method.invoke(wifiManager);
        boolean is5GhzSupported=(boolean)invoke;
1

Our approach is to look for the results of a wifi scan and look for a signal of 5GHz. That's not a good solution, 'cause it would give false negatives, but if your context is a venue where you can assure that there are 5GHz wifis near you, it can solve the issue.

See: How can I get Android Wifi Scan Results into a list?

The data you can extract from a wifi scan (look for the frequency value): the data you can extract from a wifi scan
(source: fewlaps.com)

Hope it helps!

4
  • in my case for 5ghz i am getting 2467 frequency please help. Dec 5, 2014 at 6:12
  • Probably it's a A/C router, with two signals...? Apr 2, 2015 at 9:48
  • Does it mean this approach will only work if there are 5GHz networks around?
    – surlac
    Feb 12, 2016 at 1:56
  • 2
    Yes. That's exactly what the answer says :·) Feb 13, 2016 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.