PhoneUtils.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:Mobiperf-Library 作者:
/**
 * Returns the information about cell towers in range. Returns null if the information is 
 * not available 
 * 
 * TODO(wenjiezeng): As folklore has it and Wenjie has confirmed, we cannot get cell info from
 * Samsung phones.
 */
public String getCellInfo(boolean cidOnly) {
  initNetwork();
  List<NeighboringCellInfo> infos = telephonyManager.getNeighboringCellInfo();
  StringBuffer buf = new StringBuffer();
  String tempResult = "";
  if (infos.size() > 0) {
    for (NeighboringCellInfo info : infos) {
      tempResult = cidOnly ? info.getCid() + ";" : info.getLac() + "," 
                             + info.getCid() + "," + info.getRssi() + ";";
      buf.append(tempResult);
    }
    // Removes the trailing semicolon
    buf.deleteCharAt(buf.length() - 1);
    return buf.toString();
  } else {
    return null;
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号