8

I am using new method is5GHzBandSupported() available in WifiManager since API level 21.

http://developer.android.com/reference/android/net/wifi/WifiManager.html#is5GHzBandSupported%28%29

On my Nexus 5 it is working fine (returning yes as expected), but

  • on my Samsung Galaxy S4 advance (GT-I9506) running official Android ROM in version 5.0.1, it is returning false, WHICH IS APPARENTLY INCORRECT, since this device does effectively support 5ghz...
  • same thing for my nexus 7 2013, also returning NO, which is also false

Has anybody seen this behaviour also on other models, is it a rom issue very specific to these model, or is it a misunderstanding of behaviour of this method?

Nicolas Bossard
  • 1,077
  • 1
  • 10
  • 15
  • 4
    Apparently this is not part of compatibility test suite (https://source.android.com/compatibility/overview.html) so it is not reliable... well in fact it is partly reliable if you understand it as : true ==> supported, false ==> maybe... sic – Nicolas Bossard Dec 04 '15 at 22:03

1 Answers1

0

Use below code snip to detect whether device support 5Ghz band or not.

    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;