Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.telephony.TelephonyManager;

public class Main {
    private static String UNKNOWN = "";

    /**
     * @param phone_type "getPhoneType()"
     * @param id_length Length of device id string.
     * @return The date Google release the given Android version.
     */
    public static String getDeviceIdType(int phone_type, int id_length) {
        switch (phone_type) {
        case TelephonyManager.PHONE_TYPE_GSM://1
            return "IMEI";
        case TelephonyManager.PHONE_TYPE_CDMA://2
            if (id_length == 8) {
                return "ESN";
            }
            return "MEID";
        default:
            return UNKNOWN;
        }
    }
}