有人知道是否可以获取设备范围内所有基站的信息吗?只需要获取它们的位置或其他相关信息,如何实现呢?
有人知道是否可以获取设备范围内所有基站的信息吗?只需要获取它们的位置或其他相关信息,如何实现呢?
以下是获取当前网络状态中的基站ID(CID)和位置区域码(LAC)的方法:
mPhoneStateReceiver = new PhoneStateIntentReceiver(this, new ServiceStateHandler());
mPhoneStateReceiver.notifyServiceState(MY_NOTIFICATION_ID);
mPhoneStateReceiver.notifyPhoneCallState(MY_NOTIFICATION_ID);
mPhoneStateReceiver.notifySignalStrength(MY_NOTIFICATION_ID);
mPhoneStateReceiver.registerIntent();
private class ServiceStateHandler extends Handler {
public void handleMessage(Message msg) {
switch (msg.what) {
case MY_NOTIFICATION_ID:
ServiceState state = mPhoneStateReceiver.getServiceState();
System.out.println(state.getCid());
System.out.println(state.getLac());
System.out.println(mPhoneStateReceiver.getSignalStrength());
break;
}
}
}
获取经纬度信息后,需要进行一些复杂的处理。以下是一个关于塞班系统的帖子,讨论了基站->经纬度转换:http://discussion.forum.nokia.com/forum/showthread.php?s=&threadid=19693