本文介绍了我如何获得来电号码的运营商名称在机器人..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以用下面的代码片段,以获得运营商名称:

I am able to get the carrier name using the following snippet :

TelephonyManager telephonyManager = ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE));

字符串operatorName = telephonyManager.getNetworkOperatorName();

String operatorName = telephonyManager.getNetworkOperatorName();

它的作品真的很好。   而且我还可以使用下面的代码片段获取来电号码:

It works really fine. And I am also able to get the incoming call number using the following snippet :

private final PhoneStateListener phoneStateListener = new PhoneStateListener() {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
    String callState = "UNKNOWN";
    switch (state) {
    case TelephonyManager.CALL_STATE_RINGING:

}}我的目的是要找出一个来电号码的运营商名称/服务提供商名称..?我怎样才能做到这一点..?这有可能让来电号码的位置..?说,例如:国家。请大家帮帮我: - (

}}My intention is to find out the carrier name / service provider name of an incoming number..? How can i achieve that..? Is that possible to get the incoming number's location..? say for example : country. Please help me :-(

推荐答案

这是不可能得到的任何手机号码既不符合了Android API的运营商名称。至少不是那么容易(你可能会陷入一些隐私相关的问题,我认为)。

It's not possible to get the carrier name of a whatever mobile number neither with the Android API. At least is not that easy (and you could fall into some privacy related issue i think).

阅读这篇文章的详细信息:

Read this article for more information:

http://sms411.net/2006/07/finding-out -someones载波/

当然,你可以尝试找到原来的载体(使用preFIX),但可能是不同与实际...

Of course you can try to find the original carrier (using the prefix), but that could be different from the actual one...

这篇关于我如何获得来电号码的运营商名称在机器人..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 18:08