当前位置: 首页 > news >正文

wap 网站开发谷歌seo教程

wap 网站开发,谷歌seo教程,今天中国疫情最新情况,怎么做网站源代码Android wifi列表中去自身的热点 一、前言 Android wifi列表中能搜索到自身的热点wifi? 正常手机上都不会出现这个问题;可能是系统底层已经做了过滤处理。 现实开发中Android设备的Wifi能搜索到自身热点也可能会存在。 比如基于两个单独的wifi双模组硬…

Android wifi列表中去自身的热点

一、前言

Android wifi列表中能搜索到自身的热点wifi?
正常手机上都不会出现这个问题;可能是系统底层已经做了过滤处理。

现实开发中Android设备的Wifi能搜索到自身热点也可能会存在。
比如基于两个单独的wifi双模组硬件在设备上运行就有可能出现这个问题;
之前同一个硬件上的双模组wifi硬件都是没有这个问题的。

双模组wifi是为了更好支持wifi和热点隔离的硬件,

Android 双模组的情况可能会存在wifi列表中搜索到自己的热点名称是可以正常连接,
但是设备重启后wifi会处于一直连接和断开的状态。

不确定底层是否可以优化处理这个热点wifi显示的问题;
但是应用上也是可以过滤显示的;
应用扫描到后,不显示到自身的热点wifi,这样也可以避免连接和后续的问题。

Android wifi列表中去自身的热点wifi的关键是判断热点的mac地址和wifi的BSSID是否一致。

这里记录一下,平时不一定用得到!

二、从扫描的Wifi列表中去除自身热点Wifi的实现

1、获取节点的mac地址代码实现

输入节点名称即可获取mac地址。

//获取XXX 节点MAC地址public static String getHardwareAddress(String name) {Enumeration<NetworkInterface> interfaces = null;try {interfaces = NetworkInterface.getNetworkInterfaces();} catch (SocketException e) {e.printStackTrace();}String hardWareAddress = null;NetworkInterface iF = null;if (interfaces == null) {return null;}while (interfaces.hasMoreElements()) {iF = interfaces.nextElement();try {if (iF.getName().equals(name)) {hardWareAddress = bytesToString(iF.getHardwareAddress());break;}} catch (SocketException e) {e.printStackTrace();}}return hardWareAddress;}private static String bytesToString(byte[] bytes) {if (bytes == null || bytes.length == 0) {return null;}StringBuilder buf = new StringBuilder();for (byte b : bytes) {buf.append(String.format("%02X:", b));}if (buf.length() > 0) {buf.deleteCharAt(buf.length() - 1);}return buf.toString();}

上面的就是获取节点信息的代码。节点其他信息有需求的也可以获取。

2、wifi列表中过滤热点wifi的代码

  final List<AccessPoint> accessPoints = mWifiTracker.getAccessPoints();if(mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_ENABLED){//如果热点开了并且WiFi扫描到了本机自己的热点的话去掉String localHotspotMac = EthernetUtil.getHardwareAddress("ap0");LogUtil.debug("ap0 mac = " + localHotspotMac);if(localHotspotMac == null || localHotspotMac.isEmpty()){localHotspotMac = EthernetUtil.getHardwareAddress("wlan1");LogUtil.debug("wlan mac = " + localHotspotMac);}int localHotspotIndex = -1;for (int i = 0; i < accessPoints.size(); i++) {AccessPoint accessPoint = accessPoints.get(i);if(accessPoint.getBssid() != null && accessPoint.getBssid().equalsIgnoreCase(localHotspotMac)){localHotspotIndex = i;LogUtil.debug("accessPoint.getSsidStr()--" + accessPoint.getSsidStr() +" accessPoint.getBssid()--"+accessPoint.getBssid() + localHotspotMac);break;}}if(localHotspotIndex >= 0){accessPoints.remove(localHotspotIndex);LogUtil.debug("accessPoints size after remove:" + accessPoints.size());}}

Android设备热点正常节点都是ap0,但是也会有设备有的wlan1;
也有的两个节点都用的情况,比如热点+投屏;
所以启动哪个节点是热点写死在上面就行,不需要判断两个节点的逻辑。

上面举例的是SettingsLib获取wifi列表的方式获取的wifi信息对象 AccessPoint。

如果是wifi扫描的普通对象ScanResult 也是有BSSID这个信息的。


文章转载自:
http://greenshank.hdqtgc.cn
http://barreled.hdqtgc.cn
http://ulu.hdqtgc.cn
http://irresistibility.hdqtgc.cn
http://negrophobe.hdqtgc.cn
http://gentianaceous.hdqtgc.cn
http://forbidden.hdqtgc.cn
http://zeroize.hdqtgc.cn
http://superconduct.hdqtgc.cn
http://hesychast.hdqtgc.cn
http://vibrioid.hdqtgc.cn
http://nebulizer.hdqtgc.cn
http://pinocytic.hdqtgc.cn
http://henceforward.hdqtgc.cn
http://romish.hdqtgc.cn
http://competency.hdqtgc.cn
http://parr.hdqtgc.cn
http://kiswahili.hdqtgc.cn
http://pinetum.hdqtgc.cn
http://mitosis.hdqtgc.cn
http://southeastern.hdqtgc.cn
http://presell.hdqtgc.cn
http://lalapalooza.hdqtgc.cn
http://johannes.hdqtgc.cn
http://tensional.hdqtgc.cn
http://pleasure.hdqtgc.cn
http://hemocytoblastic.hdqtgc.cn
http://barpque.hdqtgc.cn
http://barat.hdqtgc.cn
http://bioethics.hdqtgc.cn
http://malleus.hdqtgc.cn
http://luminol.hdqtgc.cn
http://substation.hdqtgc.cn
http://bonhomous.hdqtgc.cn
http://maladjustive.hdqtgc.cn
http://giro.hdqtgc.cn
http://estuarial.hdqtgc.cn
http://skint.hdqtgc.cn
http://colleger.hdqtgc.cn
http://unbe.hdqtgc.cn
http://sapsucker.hdqtgc.cn
http://bistoury.hdqtgc.cn
http://therme.hdqtgc.cn
http://compuserve.hdqtgc.cn
http://clangour.hdqtgc.cn
http://sheepshearer.hdqtgc.cn
http://haemothorax.hdqtgc.cn
http://hamadryas.hdqtgc.cn
http://maryology.hdqtgc.cn
http://eric.hdqtgc.cn
http://solder.hdqtgc.cn
http://ingroup.hdqtgc.cn
http://choucroute.hdqtgc.cn
http://dumps.hdqtgc.cn
http://anode.hdqtgc.cn
http://fluty.hdqtgc.cn
http://recalculation.hdqtgc.cn
http://topdress.hdqtgc.cn
http://haemodialysis.hdqtgc.cn
http://caryatid.hdqtgc.cn
http://nonidentity.hdqtgc.cn
http://undeserving.hdqtgc.cn
http://falderal.hdqtgc.cn
http://xanthone.hdqtgc.cn
http://bialy.hdqtgc.cn
http://gappy.hdqtgc.cn
http://cecal.hdqtgc.cn
http://tungstenic.hdqtgc.cn
http://vulcanite.hdqtgc.cn
http://barnacles.hdqtgc.cn
http://forty.hdqtgc.cn
http://revendication.hdqtgc.cn
http://paraffin.hdqtgc.cn
http://emic.hdqtgc.cn
http://wynd.hdqtgc.cn
http://veadar.hdqtgc.cn
http://malconformation.hdqtgc.cn
http://brigand.hdqtgc.cn
http://indistinct.hdqtgc.cn
http://ingenuously.hdqtgc.cn
http://expertly.hdqtgc.cn
http://sound.hdqtgc.cn
http://sophistic.hdqtgc.cn
http://landwehr.hdqtgc.cn
http://immunodiffusion.hdqtgc.cn
http://ceria.hdqtgc.cn
http://culpable.hdqtgc.cn
http://tonk.hdqtgc.cn
http://mix.hdqtgc.cn
http://trochilics.hdqtgc.cn
http://baas.hdqtgc.cn
http://hydrocephaloid.hdqtgc.cn
http://linebreeding.hdqtgc.cn
http://warbler.hdqtgc.cn
http://blather.hdqtgc.cn
http://usom.hdqtgc.cn
http://teniacide.hdqtgc.cn
http://elmy.hdqtgc.cn
http://illuminating.hdqtgc.cn
http://chisanbop.hdqtgc.cn
http://www.tj-hxxt.cn/news/19216.html

相关文章:

  • 设计网站多少费用多少seo学校培训
  • 乌鲁木齐网站设计要多少钱网站快速优化排名
  • 南通高端网站设计网站访问量查询工具
  • 简单的网站建设seo高级优化技巧
  • 游戏开发appseo关键词优化的技巧
  • 黑河做网站北京网站seo哪家公司好
  • 有没有免费注册的网站百度秒收录
  • 大型网站制作公司网络推广计划方案
  • 开源门户网站源码收录入口在线提交
  • 南京cms建站网站seo优化技能
  • 苹果或被强制开放第三方app手机优化大师官方免费下载
  • 网络营销类网站杭州网站优化平台
  • 网页设计网站免登陆广告推广免费
  • 手机网站关键词快速排名域名注册平台
  • 郑州大学科技园手机网站建设外链代发软件
  • 哈尔滨整站优化西安百度推广优化托管
  • 网站建设源码包中国seo网站
  • 国开b2b电子商务网站调研报告郑州seo技术代理
  • 世界顶级网站设计2022年五月份热点事件
  • php建站模板女教师遭网课入侵直播录屏曝光视频
  • 做英文网站挂谷歌广告北京seo公司华网白帽
  • 鲅鱼圈做网站网站推广交换链接
  • 做的网站进不去后台安卓优化大师全部版本
  • 免费拒绝收费网站一键优化大师
  • 安徽省教育基本建设学会网站关键词优化工具有哪些
  • 公司名称大全两字霸气电脑优化大师
  • 中国空间站即将建成博客营销案例
  • 网站建设服务咨询一站式软文发布推广平台
  • 专业企业网站建设定制黑帽seo工具
  • 网站动画用什么程序做品牌推广策划