当前位置: 首页>>代码示例>>Java>>正文


Java TelephonyManager.getNetworkOperatorName方法代码示例

本文整理汇总了Java中android.telephony.TelephonyManager.getNetworkOperatorName方法的典型用法代码示例。如果您正苦于以下问题:Java TelephonyManager.getNetworkOperatorName方法的具体用法?Java TelephonyManager.getNetworkOperatorName怎么用?Java TelephonyManager.getNetworkOperatorName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.telephony.TelephonyManager的用法示例。


在下文中一共展示了TelephonyManager.getNetworkOperatorName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPhoneStatus

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机状态信息
 * <p>需添加权限 {@code <uses-permission android:name="android.permission.READ_PHONE_STATE"/>}</p>
 *
 * @return DeviceId(IMEI) = 99000311726612<br>
 * DeviceSoftwareVersion = 00<br>
 * Line1Number =<br>
 * NetworkCountryIso = cn<br>
 * NetworkOperator = 46003<br>
 * NetworkOperatorName = 中国电信<br>
 * NetworkType = 6<br>
 * honeType = 2<br>
 * SimCountryIso = cn<br>
 * SimOperator = 46003<br>
 * SimOperatorName = 中国电信<br>
 * SimSerialNumber = 89860315045710604022<br>
 * SimState = 5<br>
 * SubscriberId(IMSI) = 460030419724900<br>
 * VoiceMailNumber = *86<br>
 */
public static String getPhoneStatus() {
    TelephonyManager tm = (TelephonyManager) Utils.getContext()
            .getSystemService(Context.TELEPHONY_SERVICE);
    String str = "";
    str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";
    str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";
    str += "Line1Number = " + tm.getLine1Number() + "\n";
    str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";
    str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";
    str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";
    str += "NetworkType = " + tm.getNetworkType() + "\n";
    str += "honeType = " + tm.getPhoneType() + "\n";
    str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";
    str += "SimOperator = " + tm.getSimOperator() + "\n";
    str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";
    str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";
    str += "SimState = " + tm.getSimState() + "\n";
    str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
    str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
    return str;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:42,代码来源:PhoneUtils.java

示例2: getPhoneStatus

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机状态信息
 * <p>需添加权限 {@code <uses-permission android:name="android.permission.READ_PHONE_STATE"/>}</p>
 *
 * @return DeviceId(IMEI) = 99000311726612<br>
 * DeviceSoftwareVersion = 00<br>
 * Line1Number =<br>
 * NetworkCountryIso = cn<br>
 * NetworkOperator = 46003<br>
 * NetworkOperatorName = 中国电信<br>
 * NetworkType = 6<br>
 * honeType = 2<br>
 * SimCountryIso = cn<br>
 * SimOperator = 46003<br>
 * SimOperatorName = 中国电信<br>
 * SimSerialNumber = 89860315045710604022<br>
 * SimState = 5<br>
 * SubscriberId(IMSI) = 460030419724900<br>
 * VoiceMailNumber = *86<br>
 */
@SuppressLint("HardwareIds")
public static String getPhoneStatus() {
    TelephonyManager tm = (TelephonyManager) Utils.getContext()
            .getSystemService(Context.TELEPHONY_SERVICE);
    String str = "";
    str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";
    str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";
    str += "Line1Number = " + tm.getLine1Number() + "\n";
    str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";
    str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";
    str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";
    str += "NetworkType = " + tm.getNetworkType() + "\n";
    str += "PhoneType = " + tm.getPhoneType() + "\n";
    str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";
    str += "SimOperator = " + tm.getSimOperator() + "\n";
    str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";
    str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";
    str += "SimState = " + tm.getSimState() + "\n";
    str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
    str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
    return str;
}
 
开发者ID:hoangkien0705,项目名称:Android-UtilCode,代码行数:43,代码来源:PhoneUtils.java

示例3: getPhoneStatus

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机状态信息
 * <p>需添加权限 {@code <uses-permission android:name="android.permission.READ_PHONE_STATE"/>}</p>
 *
 * @return DeviceId(IMEI) = 99000311726612<br>
 * DeviceSoftwareVersion = 00<br>
 * Line1Number =<br>
 * NetworkCountryIso = cn<br>
 * NetworkOperator = 46003<br>
 * NetworkOperatorName = 中国电信<br>
 * NetworkType = 6<br>
 * honeType = 2<br>
 * SimCountryIso = cn<br>
 * SimOperator = 46003<br>
 * SimOperatorName = 中国电信<br>
 * SimSerialNumber = 89860315045710604022<br>
 * SimState = 5<br>
 * SubscriberId(IMSI) = 460030419724900<br>
 * VoiceMailNumber = *86<br>
 */
@SuppressLint("HardwareIds")
public static String getPhoneStatus(Context context) {
    TelephonyManager tm = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    String str = "";
    str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";
    str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";
    str += "Line1Number = " + tm.getLine1Number() + "\n";
    str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";
    str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";
    str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";
    str += "NetworkType = " + tm.getNetworkType() + "\n";
    str += "PhoneType = " + tm.getPhoneType() + "\n";
    str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";
    str += "SimOperator = " + tm.getSimOperator() + "\n";
    str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";
    str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";
    str += "SimState = " + tm.getSimState() + "\n";
    str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
    str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
    return str;
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:43,代码来源:PhoneManager.java

示例4: getNetworkOperatorName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public static String getNetworkOperatorName(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    if (tm == null) {
        return "";
    }
    return "" + tm.getNetworkOperatorName();
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:8,代码来源:PhoneMessage.java

示例5: EnvironmentInfo

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
EnvironmentInfo(Context context, CachingObservable<LocationData> locationObservable, CachingObservable<Float> batteryInfoObservable) {

    locationObservable.addObserver(this);
    batteryInfoObservable.addObserver(this);

    this.osName = "android";
    this.device = Build.MODEL;
    this.osVersion = Build.VERSION.RELEASE;
    this.activityManager = (ActivityManager) context.getSystemService(Activity.ACTIVITY_SERVICE);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      this.deviceTotalMemory = Math.round((double) (getMemoryInfo(activityManager).totalMem) / (double) MEGA_BYTE);
    } else {
      this.deviceTotalMemory = -1L;
    }

    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    if (tm != null) {
      this.country = tm.getSimCountryIso();
      this.network = tm.getNetworkOperatorName();
    }

    if (this.country == null || "".equals(this.country)) {
      this.country = Locale.getDefault().getCountry();
    }

    if (this.country != null) {
      this.country = this.country.toUpperCase();
    }

    if (this.network == null || "".equals(this.network)) {
      this.network = "wifi";
    }

    if (locationObservable.getCachedValue() != null) {
      this.update(locationObservable, locationObservable.getCachedValue());
    }

  }
 
开发者ID:rakutentech,项目名称:android-perftracking,代码行数:40,代码来源:EnvironmentInfo.java

示例6: i

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public static String i(Context context) {
    try {
        TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
        if (!a(context, "android.permission.READ_PHONE_STATE")) {
            return "";
        }
        if (telephonyManager == null) {
            return "";
        }
        return telephonyManager.getNetworkOperatorName();
    } catch (Exception e) {
        e.printStackTrace();
        return "";
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:16,代码来源:bt.java

示例7: h

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public static String h(Context context) {
    try {
        TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
        if (telephonyManager == null) {
            return "";
        }
        return telephonyManager.getNetworkOperatorName();
    } catch (Exception e) {
        e.printStackTrace();
        return "";
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:bt.java

示例8: c

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public String c() {
    TelephonyManager telephonyManager = (TelephonyManager) hn.a().c().getSystemService("phone");
    if (telephonyManager == null) {
        return null;
    }
    return telephonyManager.getNetworkOperatorName();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:hi.java

示例9: getNetworkOperatorName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取移动网络运营商名称
 * <p>如中国联通、中国移动、中国电信
 */
public static String getNetworkOperatorName(Context context) {
    TelephonyManager tm = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    return tm != null ? tm.getNetworkOperatorName() : null;
}
 
开发者ID:zhuangzaiku,项目名称:AndroidCollection,代码行数:10,代码来源:NetworkUtils.java

示例10: updateCarrierName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
private void updateCarrierName() {
    TelephonyManager telephonyManager = (TelephonyManager) context.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
    carrierName = telephonyManager.getNetworkOperatorName();
}
 
开发者ID:OpenLocate,项目名称:openlocate-android,代码行数:5,代码来源:InformationFieldsFactory.java

示例11: getNetworkOperatorName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取网络运营商名称
 * <p>中国移动、如中国联通、中国电信</p>
 *
 * @return 运营商名称
 */
public static String getNetworkOperatorName() {
    TelephonyManager tm = (TelephonyManager) MyUtils.getContext().getSystemService(Context.TELEPHONY_SERVICE);
    return tm != null ? tm.getNetworkOperatorName() : null;
}
 
开发者ID:ChunweiDu,项目名称:Utils,代码行数:11,代码来源:NetworkUtil.java

示例12: getNetworkOperatorName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取移动网络运营商名称
 * <p>如中国联通、中国移动、中国电信</p>
 *
 * @param context 上下文
 * @return 移动网络运营商名称
 */
public static String getNetworkOperatorName(Context context) {
    TelephonyManager tm = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    return tm != null ? tm.getNetworkOperatorName() : null;
}
 
开发者ID:ynztlxdeai,项目名称:TextReader,代码行数:13,代码来源:NetworkUtils.java

示例13: getNetworkOperatorName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取网络运营商名称
 * <p>中国移动、如中国联通、中国电信</p>
 *
 * @return 运营商名称
 */
public static String getNetworkOperatorName() {
    TelephonyManager tm = (TelephonyManager) Utils.getContext().getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
    return tm != null ? tm.getNetworkOperatorName() : null;
}
 
开发者ID:tututututututu,项目名称:BaseCore,代码行数:11,代码来源:NetworkUtils.java

示例14: getNetworkOperatorName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取网络运营商名称
 * <p>中国移动、如中国联通、中国电信</p>
 *
 * @return 运营商名称
 */
public static String getNetworkOperatorName() {
    TelephonyManager tm = (TelephonyManager) ToolCache.getContext().getSystemService(Context.TELEPHONY_SERVICE);
    return tm != null ? tm.getNetworkOperatorName() : null;
}
 
开发者ID:StickyTolt,项目名称:ForeverLibrary,代码行数:11,代码来源:NetworkUtils.java

示例15: getNetworkOperatorName

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取网络运营商名称
 * <p>中国移动、如中国联通、中国电信</p>
 *
 * @return 运营商名称
 */
public static String getNetworkOperatorName() {
    TelephonyManager tm = (TelephonyManager) Utils.getContext().getSystemService(Context.TELEPHONY_SERVICE);
    return tm != null ? tm.getNetworkOperatorName() : null;
}
 
开发者ID:hoangkien0705,项目名称:Android-UtilCode,代码行数:11,代码来源:NetworkUtils.java


注:本文中的android.telephony.TelephonyManager.getNetworkOperatorName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。