private void sendGsmBrodcat(CellLocation location) {
Log.d(TAG, "onCellLocationChanged : " + location);
if (location instanceof GsmCellLocation) {
String networkOperator = telephonyManager.getNetworkOperator();
if (networkOperator != null) {
// Mobile Country Code
int mcc = Integer.parseInt(networkOperator.substring(0, 3));
// Mobile Network Code
int mnc = Integer.parseInt(networkOperator.substring(3));
Log.d(TAG, String.format("networkOperator mcc=%s / mnc=%s", mcc, mnc));
}
GsmCellLocation gsmLocation = (GsmCellLocation)location;
int cid = gsmLocation.getCid();
int lac = gsmLocation.getLac();
sendGsmBrodcat(cid, lac);
}
}
BackgroudLocService.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:geoPingProject
作者:
评论列表
文章目录