如何使用android API从android中获取wifi网络的名称? [英] How to get name of wifi-network out of android using android API?

查看:21
本文介绍了如何使用android API从android中获取wifi网络的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为我应该使用 NetworkInterface::getDisplayName.我有一些名字,但这个名字与我在选择要连接的网络时看到的这个名字不同.

I thought that I should use NetworkInterface::getDisplayName. I got some name, but this name is different that this name which I can see, when I choosing to which network I want to connect.

推荐答案

android.net.wifi.WifiInfo.getSSID?

WifiManager wifiMgr = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
String name = wifiInfo.getSSID();

这篇关于如何使用android API从android中获取wifi网络的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆