简体   繁体   English

检索详细信息,例如MCC,MNC,LAC,CellID

[英]Retrieve Details Such as MCC,MNC,LAC,CellID

Is it possible to get the following information of a incoming number in android 是否有可能在android中获取传入号码的以下信息

  1. MCC MCC
  2. MNC MNC
  3. LAC LAC
  4. Cell ID 小区ID

I have tried the code 我已经尝试过代码

        TelephonyManager tel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
        String networkOperator = tel.getNetworkOperator();

        if (networkOperator != null) {
            mcc = Integer.parseInt(networkOperator.substring(0, 3));
            mnc = Integer.parseInt(networkOperator.substring(3));
        }

It returns the details of the current SIM, But I want to find it for the incoming number 它返回当前SIM卡的详细信息,但我想在输入号码中找到它

This is tricky for this you need to implment a application in that user's phone also. 这很棘手,因为您还需要在该用户的手机中实现一个应用程序。 Because when you are getting the call from some user then you will get only MSISDN through which you can not gwt the details. 因为当您收到某个用户的呼叫时,您只会得到MSISDN,无法通过它获取详细信息。 There should be a app on other users mobile which will trigger a event in case he makes a call, now that app can fetch the MCC.MNC and cell id and can send via sms to called party and then called party can process this sms to get the details. 在其他用户移动设备上应该有一个应用程序,该应用程序可以在他拨打电话的情况下触发事件,现在该应用程序可以获取MCC.MNC和单元ID,并且可以通过短信发送给被叫方,然后被叫方可以处理该短信以获取详细信息。 Its simple logic that if you want to spy someone then you have install something at his end. 它的简单逻辑是,如果您想监视某人,那么您必须在他的末端安装一些东西。

This would give you the # : 这会给你#:

TelephonyManager telephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String sim = telephonyManager.getSimSerialNumber();

Also add this permission to the manifest : 还要将此权限添加到清单中:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

for getting the mobile # change it to : 用于获取手机#将其更改为:

String sim = telephonyManager.getLine1Number();

You could also refer to this : Access the SIM Card with an Android Application? 您也可以参考以下内容: 使用Android应用程序访问SIM卡?

For getting incoming caller sim details refer to this : http://sms411.net/2006/07/finding-out-someones-carrier/ and How do i get the carrier name of an incoming number in android..? 有关获取来电者sim的详细信息,请参阅: http : //sms411.net/2006/07/finding-out-someones-carrier/以及如何在android中获取来电号码的运营商名称。

The solution : 解决方案 :

You can't because the data of incomming call contains only the number as string, and by sms ? 您不能因为来电呼叫的数据仅包含数字作为字符串和sms? also no because the user data header of the message can be null !!! 也没有,因为消息的用户数据标头可以为null !!!

If you develop a current location application, it can be used only by the owner of the cell phone. 如果您开发当前位置应用程序,则只能由手机所有者使用。

In the other hand, there are some developer who want to use the AT command to request the call but the only data comes with a call is only the number and only the number !!! 另一方面,有些开发人员想使用AT命令来请求调用,但是调用附带的唯一数据是数字和数字!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM