我發現了太多的代碼來獲取cell-id和位置區域代碼,我使用下面的代碼來獲取cell-id和location區域代碼。如何在Android中獲取正確的單元格ID和位置區域代碼?
TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation();
int cid = cellLocation.getCid();
int lac = cellLocation.getLac();
的問題是,當我使用Airtel的SIM卡能正常工作並給小區id = 4331和LOC-610。但是當我使用relience-sim卡時,它給出錯誤的結果cell-id = 11541和loc = 18823。我該如何解決這個問題?
嗨,我使用的網址http://sunil-android.blogspot.in/2013/01/convert-celllocation-to-real-location.html的代碼來獲取位置,它對Airtel工作正常,但如果可靠,它不起作用。正如我所知,這意味着我在獲得可靠信息時所獲得的位置區域代碼和單元ID不正確。任何幫助? – User10001
有很多應用程序顯示正確的單元格編號,但我的代碼不適用於3g simcard。 – User10001
通過使用'cid = cellLocation.getCid()&0xffff;',您的relience-sim的結果如何? – sschrass