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 基站
最新推荐文章于 2024-08-17 14:22:19 发布