Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android新功能-如何检测正在使用的手机类型?_Android - Fatal编程技术网

android新功能-如何检测正在使用的手机类型?

android新功能-如何检测正在使用的手机类型?,android,Android,我需要找出手机是galaxy note 2还是冰激凌,因为我必须编写一些代码来解决其中的bug 我试图查看一些文档,但找不到任何东西。。。有人能提供一些帮助吗?使用下面的代码获取有关该设备的所有信息,并检查其galaxy Note2或sdk版本,查看其冰淇淋或Kitkat:p String Info3 = android.os.Build.VERSION.RELEASE; String Info4 = android.os.Build.DEVICE;

我需要找出手机是galaxy note 2还是冰激凌,因为我必须编写一些代码来解决其中的bug


我试图查看一些文档,但找不到任何东西。。。有人能提供一些帮助吗?

使用下面的代码获取有关该设备的所有信息,并检查其galaxy Note2或sdk版本,查看其冰淇淋或Kitkat:p

        String Info3 = android.os.Build.VERSION.RELEASE;
        String Info4 = android.os.Build.DEVICE; 
        String Info5 = android.os.Build.MODEL; 
        String Info6 = android.os.Build.PRODUCT; 
        String Info7 = android.os.Build.BRAND; 
        String Info8 = android.os.Build.DISPLAY; 
        String Info9 = android.os.Build.CPU_ABI; 
        String Info10 = android.os.Build.CPU_ABI2; 
        String Info11 = android.os.Build.UNKNOWN; 
        String Info12 = android.os.Build.HARDWARE;
        String Info13 = android.os.Build.ID; 
        String Info14 = android.os.Build.MANUFACTURER; 
        String Info15 = android.os.Build.SERIAL; 
        String Info16 = android.os.Build.USER; 
        String Info2 = System.getProperty("os.version");
        String Info17 = android.os.Build.HOST; 

更多信息请访问

您有太多的详细信息

    /**
     * @TelePhonyManager: for telephony related details some permission like CoarseLocation, PhoneState are neccessary to get some Telephony Details
     */

    String telephonyInfo = "", buildInfo = "", deviceId, cellLocation, deviceSoftwareVersion, number, networkOperatorIso, networkOperatorName, NetworkType, PhoneType, simOperatorISO, simOperatorName, simSerialNumber, subscriberId, voiceMailNumber, isNetworkRoaming;
    try
    {
        TelephonyManager tm =
                (TelephonyManager) mContext
                        .getSystemService(Context.TELEPHONY_SERVICE);
        GsmCellLocation gcl =
                (GsmCellLocation) tm
                        .getCellLocation();
        gcl.requestLocationUpdate();

        deviceId = "";
        cellLocation = "";
        telephonyInfo =
                "TelephonyInfo \n\tCellLocation_CID_LAC_PSC_MCCMNC ="
                        +
                        String.valueOf(gcl
                                .getCid()
                                + "_"
                                + gcl.getLac()
                                + "_"
                                + gcl.getPsc()) + String.valueOf(tm.getNetworkOperator())
                        + "\n\tDeviceId ="
                        +
                        String.valueOf(tm
                                .getDeviceId())
                        + "\n\tDviceSoftwareVersion ="
                        +
                        String.valueOf(tm
                                .getDeviceSoftwareVersion())
                        + "\n\tNumber ="
                        +
                        String.valueOf(tm
                                .getLine1Number())
                        + "\n\tNetworkOperatorIso ="
                        +
                        String.valueOf(
                                tm.getNetworkCountryIso())
                                .toUpperCase()
                        + "\n\tNetworkOperatorName ="
                        +
                        String.valueOf(tm
                                .getNetworkOperatorName())
                        + "\n\tNetworkType ="
                        +
                        String.valueOf(tm
                                .getNetworkType())
                        +
                        "\n\tPhoneType ="
                        +
                        String.valueOf(tm
                                .getPhoneType())
                        + "\n\tSimOperatorISO ="
                        +
                        String.valueOf(
                                tm.getSimCountryIso())
                                .toUpperCase()
                        + "\n\tSimOperatorName ="
                        +
                        String.valueOf(
                                tm.getSimOperatorName())
                                .toUpperCase()
                        + "\n\tSimSerialNumber ="
                        +
                        String.valueOf(tm
                                .getSimSerialNumber())
                        + "\n\tSubscriberId ="
                        +
                        String.valueOf(tm
                                .getSubscriberId())
                        + "\n\tVoiceMailNumber ="
                        +
                        String.valueOf(tm
                                .getVoiceMailNumber())
                        + "\n\tIsNetworkRoaming ="
                        +
                        String.valueOf(tm
                                .isNetworkRoaming());
    }
    catch(Exception e)
    {       
    }
    /*
     * BuildVersion Related Detials
     */

    try
    {
        buildInfo =
                "Build\n\t BOARD="
                        + Build.BOARD
                        + "\n\t BOOTLOADER="
                        + Build.BOOTLOADER
                        + "\n\t BRAND="
                        + Build.BRAND
                        + "\n\t CPU_ABI="
                        + Build.CPU_ABI
                        + "\n\t CPU_ABI2="
                        + Build.CPU_ABI2
                        + "\n\t DEVICE="
                        + Build.DEVICE
                        + "\n\t DISPLAY="
                        + Build.DISPLAY
                        + "\n\t FINGERPRINT="
                        + Build.FINGERPRINT
                        + "\n\t HARDWARE="
                        + Build.HARDWARE
                        + "\n\t HOST="
                        + Build.HOST
                        + "\n\t ID="
                        + Build.ID
                        + "\n\t MANUFACTURER="
                        + Build.MANUFACTURER
                        + "\n\t MODEL="
                        + Build.MODEL
                        + "\n\t PRODUCT="
                        + Build.PRODUCT
                        + "\n\t SERIAL="
                        + Build.SERIAL
                        + "\n\t TAGS="
                        + Build.TAGS
                        + "\n\t TIME="
                        + Build.TIME
                        + "\n\t TYPE="
                        + Build.TYPE
                        + "\n\t UNKNOWN="
                        + Build.UNKNOWN
                        + "\n\t USER="
                        + Build.USER
                        + "\n\n\nBuild.VERSION \n\tVERSION.CodeName="
                        + Build.VERSION.CODENAME
                        + "\n\t VERSION.INCREMENTAL= "
                        + Build.VERSION.INCREMENTAL
                        + "\n\t VERSION.RELEASE= "
                        + Build.VERSION.RELEASE
                        + "\n\t VERSION.SDK_INT= "
                        + Build.VERSION.SDK_INT;
    }
    catch(Exception e)
    {}