ken
ken

Reputation: 53

Android how to get router name?

I need to known router's name. I read some relevant information not find method。 any way to get it? For example router name's:TP_Link. how to get it's name?

Upvotes: 2

Views: 2275

Answers (2)

atomofiron
atomofiron

Reputation: 170

To find out the model of the router you should have a database of MAC addresses(first half - xx:xx:xx...) and manufacturers. I found rather big base in text form http://standards-oui.ieee.org/oui/oui.txt. For example WiFi Analyzer use this db (taken from WiFiAnalyzer.apk/res/raw/ieee_oui.db)

Upvotes: 0

Ganesh AB
Ganesh AB

Reputation: 4698

You will get WiFi network details (name etc.) from below code snippet :

   WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
   WifiInfo wifiInfo = wifiManager.getConnectionInfo();
   Log.d("wifiInfo", wifiInfo.toString());
   Log.d("SSID",wifiInfo.getSSID());

Don't forget to add permission in android manifest file

<uses-permission 
android:name="android.permission.ACCESS_WIFI_STATE">
</uses-permission>

Upvotes: 3

Related Questions