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 = "";

    /**
     * Returns a constant indicating the device phone type.
     * This indicates the type of radio used to transmit voice calls.
     * @param phone_type "getPhoneType()"
     */
    public static String getPhoneTypeStr(int phone_type) {
        switch (phone_type) {
        case TelephonyManager.PHONE_TYPE_NONE://0
            return "PHONE_TYPE_NONE";
        case TelephonyManager.PHONE_TYPE_GSM://1
            return "PHONE_TYPE_GSM";
        case TelephonyManager.PHONE_TYPE_CDMA://2
            return "PHONE_TYPE_CDMA";
        case TelephonyManager.PHONE_TYPE_SIP://3
            return "PHONE_TYPE_SIP";//API 11
        default:
            return UNKNOWN;
        }
    }
}