Android 獲取基站資訊

2021-09-01 20:13:23 字數 807 閱讀 3841

android 基站分cdmacelllocation和gsmcelllocation,要根據不同的sim卡轉成不同的物件

telephonymanager tm = (telephonymanager) getsystemservice(context.telephony_service);

int type = tm.getnetworktype();//獲取網路型別

//在中國,移動的2g是egde,聯通的2g為gprs,電信的2g為cdma,電信的3g為evdo

location loc = null;

arraylist cellid = new arraylist();

//中國電信為ctc

//network_type_evdo_a是中國電信3g的getnetworktype

//network_type_cdma電信2g是cdma

if (type == telephonymanager.network_type_evdo_a || type == telephonymanager.network_type_cdma || type ==telephonymanager.network_type_1xrtt)

//移動2g卡 + cmcc + 2

//type = network_type_edge

//聯通的2g經過測試 china unicom 1 network_type_gprs

else if(type == telephonymanager.network_type_edge || type == telephonymanager.network_type_gprs)

android獲取基站資訊 cid 和lac

首先在androidmanifest.xml檔案裡新增許可權 telephonymanager tel telephonymanager getsystemservice context.telephony service suppresslint missingpermission cellloc...

關於獲取基站資訊總結

1 簡述 現在用於移動端主流的定位方式有三種,gps,wifi和基站定位,他們之間的定位準確度依次遞減。但是有時難免有獲取基站資訊的需求 比如三大運營商想要校準基站位置 下面就獲取移動基站 lac,cid 資訊進行分析。名詞釋義 taccid mccmcn 想要定位唯一的基站,只需要獲得手機上的la...

android獲取硬體資訊

1.獲取cpu型號 private static string getcpuname return array 1 catch filenotfoundexecption e catch ioexception e return null 2.獲取cpu核心數 private int getnumc...