get Phone Type - Android Phone

Android examples for Phone:Phone Information

Description

get Phone Type

Demo Code


//package com.java2s;

import android.telephony.TelephonyManager;

public class Main {
    private static String getPhoneType(TelephonyManager telMgr) {
        int phoneType = telMgr.getPhoneType();

        String phoneTypeString = "NA";

        switch (phoneType) {

        case TelephonyManager.PHONE_TYPE_GSM:

            phoneTypeString = "GSM";

            break;

        case TelephonyManager.PHONE_TYPE_NONE:

            phoneTypeString = "NONE";

            break;

        }//  w w w  .  j a  v a  2  s .  co  m
        return phoneTypeString;

    }
}

Related Tutorials