类 PhoneUtils


  • public class PhoneUtils
    extends java.lang.Object
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static java.lang.String getDeviceId​(android.content.Context context)
      Return the unique device id.
      static java.lang.String getDeviceName()  
      static java.lang.String getImei​(android.content.Context context)  
      static java.lang.String getIMEI​(android.content.Context context)
      Return the IMEI.
      static java.lang.String getImeiOrMeid​(boolean isImei, android.content.Context context)  
      static java.lang.String getIMSI​(android.content.Context context)
      Return the IMSI.
      static java.lang.String getManufacturer()  
      static java.lang.String getMEID​(android.content.Context context)
      Return the MEID.
      static java.lang.String getModel()  
      static int getPhoneType​(android.content.Context context)
      Returns the current phone type.
      static java.lang.String getSDKVersionName()  
      static java.lang.String getSerial()
      Return the serial of device.
      static java.lang.String getSimOperatorByMnc​(android.content.Context context)
      Return the sim operator using mnc.
      static java.lang.String getSimOperatorName​(android.content.Context context)
      Return the sim operator name.
      static java.lang.String getVerName​(android.content.Context context)  
      static boolean isPhone​(android.content.Context context)
      Return whether the device is phone.
      static boolean isSimCardReady​(android.content.Context context)
      Return whether sim card state is ready.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • isPhone

        public static boolean isPhone​(android.content.Context context)
        Return whether the device is phone.
        返回:
        true: yes
        false: no
      • getDeviceId

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static java.lang.String getDeviceId​(android.content.Context context)
        Return the unique device id.

        If the version of SDK is greater than 28, it will return an empty string.

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

        返回:
        the unique device id
      • getSerial

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static java.lang.String getSerial()
        Return the serial of device.
        返回:
        the serial of device
      • getImei

        public static java.lang.String getImei​(android.content.Context context)
      • getIMEI

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static java.lang.String getIMEI​(android.content.Context context)
        Return the IMEI.

        If the version of SDK is greater than 28, it will return an empty string.

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

        返回:
        the IMEI
      • getMEID

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static java.lang.String getMEID​(android.content.Context context)
        Return the MEID.

        If the version of SDK is greater than 28, it will return an empty string.

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

        返回:
        the MEID
      • getImeiOrMeid

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static java.lang.String getImeiOrMeid​(boolean isImei,
                                                     android.content.Context context)
      • getIMSI

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static java.lang.String getIMSI​(android.content.Context context)
        Return the IMSI.

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

        返回:
        the IMSI
      • getPhoneType

        public static int getPhoneType​(android.content.Context context)
        Returns the current phone type.
        返回:
        the current phone type
        • TelephonyManager.PHONE_TYPE_NONE
        • TelephonyManager.PHONE_TYPE_GSM
        • TelephonyManager.PHONE_TYPE_CDMA
        • TelephonyManager.PHONE_TYPE_SIP
      • isSimCardReady

        public static boolean isSimCardReady​(android.content.Context context)
        Return whether sim card state is ready.
        返回:
        true: yes
        false: no
      • getSimOperatorName

        public static java.lang.String getSimOperatorName​(android.content.Context context)
        Return the sim operator name.
        返回:
        the sim operator name
      • getSimOperatorByMnc

        public static java.lang.String getSimOperatorByMnc​(android.content.Context context)
        Return the sim operator using mnc.
        返回:
        the sim operator
      • getModel

        public static java.lang.String getModel()
      • getManufacturer

        public static java.lang.String getManufacturer()
      • getDeviceName

        public static java.lang.String getDeviceName()
      • getVerName

        public static java.lang.String getVerName​(android.content.Context context)
      • getSDKVersionName

        public static java.lang.String getSDKVersionName()