Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;

import android.telephony.TelephonyManager;

public class Main {
    public static boolean canMakeCall(Context ctx) {
        TelephonyManager manager = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
        return manager.getSimState() == TelephonyManager.SIM_STATE_READY
                && (manager.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM
                        || manager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA);
    }
}