* android.telephony.TelephonyManager类

作用:

访问设备上的电话通讯服务的信息

获取方法:

Context.getSystemService(Context.TELEPHONY_SERVICE)获取

* GsmCellLocation类

作用:封装GSM移动电话的基站信息


具体代码实现:

// 获取TelephonyManager实例

TelephonyManager tManager = (TelephonyManager)Context.getSystemService(Context.TELEPHONY_SERVICE);

// 获取封装了基站信息的GsmCellLaction对象

// 需要ACCESS_COARSE_LACTION或者ACCESS_FINE_LACTION权限

GsmCellLocation gsm = (GsmCellLocation)tManager.getCellLocation();

//得到LAC

int lac = gsm.getLac();

//得到 Cellid

int cid = gsm.getCid();