经过大量研究后,我喜欢将LAC用于基于位置的应用程序中以查找Location.i对LAC有一些疑问1)我可以从LAC获得哪些信息? 2)如何使用LAC查找位置名称? 3)是否有任何网站或数据库可了解我所在位置的LAC?
我不需要密码,我需要这些问题的答案,请帮助我
最佳答案
这是获取手机信号塔信息的代码:
public static void getCellTowerInfo() {
TelephonyManager mTelephonyManager = (TelephonyManager) POContext.getContext().getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation location = (GsmCellLocation) mTelephonyManager.getCellLocation();
if (location != null) {
// cell id of the
POGlobals.PhoneInfo.CellID = String.valueOf(location.getCid());
Log.i(POGlobals.TAG, "CellID of the Device-->" + POGlobals.PhoneInfo.CellID);
// get theLAC
POGlobals.PhoneInfo.LAC = String.valueOf(location.getLac());
Log.i(POGlobals.TAG, "LAC of the Device-->" + POGlobals.PhoneInfo.LAC);
}
if (mTelephonyManager != null) {
// get the combination of MNC+MCC for the GSM Networks only
if (mTelephonyManager.getNetworkOperator() != null && mTelephonyManager.getNetworkOperator().length() > 0) {
POGlobals.PhoneInfo.MCC = mTelephonyManager.getNetworkOperator().substring(0, 3);
POGlobals.PhoneInfo.MNC = mTelephonyManager.getNetworkOperator().substring(3);
mTelephonyManager.getNetworkType();
} else {
// Phone is in Airplane Mode situation
Logger.e(POGlobals.TAG, "TelephonyManager service is NULL");
}
}
}
请删除记录器和全局变量的“编译”错误。
LAC是服务提供商提供的位置区号,具体取决于您最近的塔楼。