类 PhoneUtils


  • public class PhoneUtils
    extends Object
    • 方法详细资料

      • isPhone

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

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static String getDeviceId​(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

        public static String getSerial()
        Return the serial of device.
        返回:
        the serial of device
      • getIMEI

        @RequiresPermission("android.permission.READ_PHONE_STATE")
        public static String getIMEI​(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 String getMEID​(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 String getImeiOrMeid​(boolean isImei,
                                           Context context)
      • getIMSI

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

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

        返回:
        the IMSI
      • isSimCardReady

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

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

        public static String getSimOperatorByMnc​(Context context)
        Return the sim operator using mnc.
        返回:
        the sim operator
      • getDeviceModel

        public static String getDeviceModel()
      • getDeviceManufacturer

        public static String getDeviceManufacturer()
      • getDeviceName

        @RequiresApi(api=25)
        public static String getDeviceName​(Context context)
      • getDeviceName

        public static String getDeviceName()
      • getDeviceBoard

        public static String getDeviceBoard()
      • getDeviceBrand

        public static String getDeviceBrand()
      • getVerName

        public static String getVerName​(Context context)
      • getOsVersion

        public static String getOsVersion()
      • getAndroidVersion

        public static int getAndroidVersion()
      • getIp

        public static String getIp()
      • intToIp

        public static String intToIp​(int i)
        将ip的整数形式转换成ip形式
      • getNetworkType

        public static String getNetworkType​(Context context)