Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.telephony.TelephonyManager;

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

    public static String convertPhoneType(int type) {
        switch (type) {
        case TelephonyManager.PHONE_TYPE_NONE:
            return "NONE";
        case TelephonyManager.PHONE_TYPE_GSM:
            return "GSM";
        case TelephonyManager.PHONE_TYPE_CDMA:
            return "CDMA";
        case TelephonyManager.PHONE_TYPE_SIP:
            return "SIP";
        default:
            return UNKNOWN;
        }
    }
}