2011-10-31 31 views
2

經過大量研究後我很喜歡LAC可以用於基於位置的應用程序來查找Location.i有幾個關於LAC1的問題我可以從中獲得哪些信息LAC? 2)我如何找到使用LAC的位置名稱? 3)是否有任何網站或數據庫知道我的位置LAC?
我不需要的代碼,我需要這些問題的答案,普萊舍幫助我如何獲得使用LAC的位置名稱

回答

1

這裏是讓小區發射塔信息代碼:

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是服務提供商提供的位置區域代碼,取決於您最近的塔樓。

+0

謝謝you.but我怎麼能匹配這個位置名稱 – sajith

+1

這個LAC會返回你的整數代碼。如果您想比較字符串的實際位置,則需要對緯度和經度進行反向地理編碼。所以你會得到的位置,直到steet名稱。 –

1

您可以使用OpenCellID's API來獲取使用MCC,MNC,LAC和CellID的位置。

相關問題