/**
* 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;
}
}
PhoneUtils.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:Mobilyzer
作者:
评论列表
文章目录