获取手机信号塔位置 - 安卓

2022-09-04 22:16:10

有谁知道是否有可能获得有关设备范围内所有蜂窝塔的信息?只是能够获得它们的位置,或者关于它们的任何其他信息,以及我该怎么做?


答案 1

以下是从当前网络状态获取手机信号塔 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


答案 2

推荐