How to get the connection strength of Wifi access points?

前端 未结 5 1952
谎友^
谎友^ 2020-12-05 01:09

I am building an application reading the signal strength of each available Wifi access point.

I\'ve written code like:

    wifi = (WifiManager) getS         


        
5条回答
  •  死守一世寂寞
    2020-12-05 01:46

    According to the Android API documentation WifiManager.getConfiguredNetworks() does not fill the signal strength paramters. This data only represents the remembered access point settings, not the visible ones.

    To get actually visible networks you must call WifiManager.startScan() to initiate WiFi radio scanning and WifiManager.getScanResults() after a while to get the scanning results.

提交回复
热议问题