android获取周围基站信息
来源:互联网 发布:nginx body filter 编辑:程序博客网 时间:2024/04/30 15:17
public static List<GsmInfo> getGsmInfoList(Context context) { TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); List<CellInfo> cellInfoList = manager.getAllCellInfo(); List<GsmInfo> gsmInfoList = new ArrayList<>(); if (cellInfoList != null) { L.e("cellInfoList.size="+cellInfoList.size()); GsmInfo gsmInfo; for (CellInfo info : cellInfoList) { L.e("info.toString():" + info.toString()); if (info.toString().contains("CellInfoLte")) { CellInfoLte cellInfoLte = (CellInfoLte) info; CellIdentityLte cellIdentityLte = cellInfoLte.getCellIdentity(); gsmInfo = new GsmInfo(); gsmInfo.setMcc(cellIdentityLte.getMcc()); gsmInfo.setMnc(cellIdentityLte.getMnc()); gsmInfo.setLac(cellIdentityLte.getTac()); gsmInfo.setCid(cellIdentityLte.getCi()); gsmInfo.setRssi(cellInfoLte.getCellSignalStrength().getDbm()); gsmInfoList.add(gsmInfo); } else if (info.toString().contains("CellInfoGsm")) { CellInfoGsm cellInfoGsm = (CellInfoGsm) info; CellIdentityGsm cellIdentityGsm = cellInfoGsm.getCellIdentity(); gsmInfo = new GsmInfo(); gsmInfo.setMcc(cellIdentityGsm.getMcc()); gsmInfo.setMnc(cellIdentityGsm.getMnc()); gsmInfo.setLac(cellIdentityGsm.getLac()); gsmInfo.setCid(cellIdentityGsm.getCid()); gsmInfo.setRssi(cellInfoGsm.getCellSignalStrength().getDbm()); gsmInfoList.add(gsmInfo); } else if (info.toString().contains("CellInfoCdma")) { CellInfoCdma cellInfoCdma = (CellInfoCdma) info; CellIdentityCdma cellIdentityCdma = cellInfoCdma.getCellIdentity(); gsmInfo = new GsmInfo(); gsmInfo.setMcc(460); gsmInfo.setMnc(0); gsmInfo.setLac(0); gsmInfo.setCid(cellIdentityCdma.getBasestationId()); gsmInfo.setRssi(cellInfoCdma.getCellSignalStrength().getDbm()); gsmInfoList.add(gsmInfo); } } } else { L.e("cellInfoList == null"); } return gsmInfoList;}
0 0
- android获取周围基站信息
- 获取周围基站的信息 getNeighboringCellInfo
- 获取周围基站的信息 getNeighboringCellInfo
- android 获取基站信息
- Android 获取基站信息
- Android基站定位——通过手机信号获取基站信息
- android根据基站信息获取经纬度
- Android获取手机基站信息并进行基站定位(基站定位原理)
- Android获取手机基站信息并进行基站定位(基站定位原理)
- 手机基站信息获取
- Android中获取基于基站的经纬度信息
- android GSM+CDMA基站定位 获取详细位置信息
- android GSM+CDMA基站定位--获取移动网络相关信息
- android获取基站定位信息的文章收集
- Android中获取基于基站的经纬度信息
- Android基站定位——通过手机信号获取基站信息(一)
- Android基站定位——通过手机信号获取基站信息(一)
- Android基站定位——通过手机信号获取基站信息(一)
- NGUI学习笔记(六):ScrollView、Grid和Table
- 【转载】在erlang项目中使用protobuf
- CodeForces 627 B.Factory Repairs(BIT)
- 如何用递归算法判断一个数组是否递增
- bzoj 4031: [HEOI2015]小Z的房间 矩阵树定理
- android获取周围基站信息
- 对象反序列化时,如果父类未实现序列化接口,则反序列出的对象会再次调用父类的构造函数来完成属于父类那部分内容的初始化
- 第六天-网页的head制作——明天继续写下面的
- bash,awk分离出文件夹目录下最后的文件
- 机试算法题(1)--排序算法
- Java设计模式之状态模式
- 一个BOM头引发的血案!!!
- springmvc之文件上传MultipartResolver
- 【LIS变形】 zoj 2319 Beautiful People