TelephonyManager telephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
CellLocation cellLocation = telephonyManager.getCellLocation();
//判断CellLocation类型,是gsm或cdma
if(cellLocation!=null){
if(cellLocation instanceof GsmCellLocation){
GsmCellLocation gsmCellLocation = (GsmCellLocation)cellLocation;
gsmCellLocation.getCid();
gsmCellLocation.getLac();
}else if(cellLocation instanceof CdmaCellLocation){
CdmaCellLocation cdmaCellLocation = (CdmaCellLocation)cellLocation;
cdmaCellLocation.getBaseStationLatitude();
cdmaCellLocation.getBaseStationLongitude();
}
}
android 基站
最新推荐文章于 2025-08-07 23:59:18 发布