1

I was able to scan all wifi networks with the wifimanager.getScanResults(). In the next step I extracted the SSID and signal level of the wifi network.

private List<String> showOnlySSIDAndLevel(List<ScanResult> networks) {
    List<String> networkList = new ArrayList<String>();
    for(ScanResult result : networks){
        int level = WifiManager.calculateSignalLevel(result.level, 5) + 1;
        String content = result.SSID + " \tSignal strength: " + level;
        networkList.add(content);
    }
    return networkList;
}

I have the signal level in a format, where it's between 1 - 5 (5 is the best signal level) How can I use this to have a graphical representation of the different wifi signal levels. I coudn't find a UI for this. Do I need a graphic for each of the 5 possible level or is there another way? How is the internal Android Settings (Wifi scan results) doing it?

user574080
  • 146
  • 1
  • 3
  • 11

2 Answers2

2

I think found a better option ...

imageView.setIcon(android.R.drawable.stat_sys_wifi_signal_<strength>)

where strength is a variable in the range of 0 to 4...

For more details refer to http://androiddrawableexplorer.appspot.com/

Sreekanth Karumanaghat
  • 3,383
  • 6
  • 44
  • 72
  • 3
    [Here](http://androiddrawables.com/status.html) is a list of android icons for all versions. The wifi signal icon is only available until 2.2. For instance it's not available anymore in Android 4. It's too late for me anyways. I have created my own wifi icons starting with an [Open Clipart](http://openclipart.org/detail/76159/free-wifi-sign-by-shokunin) and Inkscape, which was fairly simple – user574080 Mar 19 '13 at 21:51
1

You can use the built-in RatingBar component. You can make it read-only by giving it a ratingBarStyleSmall or ratingBarStyleIndicator style.

Nachi
  • 4,218
  • 2
  • 37
  • 58
  • Wouldn't it be confusing for the user to see stars, which usually symbolize a rating? I would rather show some kind of wifi symbol. How hard is it to customize the style of this UI in compare to just create 5 graphics for each signal level? – user574080 Mar 18 '13 at 12:42
  • 2
    Indeed, you can define a custom style that uses different images. More info here: http://stackoverflow.com/a/2215186/1025599 – Nachi Mar 18 '13 at 12:54