Android 怎么判断连接了哪个无线路由器 判断获取 bissid也是路由器的MAC 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /** * 获得本机IP * @return * @throws Exception */ public String getLocalIp() throws Exception { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress()) { String ip = inetAddress.getHostAddress(); return (mustInputVal(ip, Domain.NUMBERS + ".") ? ip : ""); } } } return ""; } 就是我只用判断WIFI的SSID 就可以了吗? 查询语句一直查不到数据,各位请帮下忙,谢谢 关于类的初级问题 在NDK层用SKIA出现了看不懂的LOG消息----no context for glyph 0,不知道什么意思?! 求助,如何实现 微博 “分享” 信息 FOR()语法求解 factory android下打开flash网页出错 开发具备语音识别功能的 Android* 应用 送分!!求Android多人即时聊天视频Demo或者framework 何时将记录用户操作的信息发送到服务端 安卓数据库问题,update和delete android 关于TranslateAnimation动画的问题??
* 获得本机IP
* @return
* @throws Exception
*/
public String getLocalIp() throws Exception {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
String ip = inetAddress.getHostAddress();
return (mustInputVal(ip, Domain.NUMBERS + ".") ? ip : "");
}
}
}
return "";
}