有谁知道是否有可能获得有关设备范围内所有蜂窝塔的信息?只是能够获取它们的位置,或者也许有关它们的任何其他信息,以及我将如何去做呢?
最佳答案
这是从当前网络状态获取蜂窝塔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;
}
}
}
之后获取Lat,Lng位置信息会比较麻烦。这是一篇有关Symbian的帖子的链接,但其中涉及到Cell Tower-> Lat,Lng转换:http://discussion.forum.nokia.com/forum/showthread.php?s=&threadid=19693