Access to the local IMSI number - Android Phone

Android examples for Phone:Phone Information

Description

Access to the local IMSI number

Demo Code


//package com.java2s;

import android.content.Context;

import android.telephony.TelephonyManager;

public class Main {
    /** Access to the local IMSI number */
    public static String getImsi(Context context) {
        TelephonyManager phoneMgr = (TelephonyManager) context
                .getSystemService(Context.TELEPHONY_SERVICE);
        String imsi = phoneMgr.getSubscriberId();
        return imsi;
    }//from  w  w  w .  ja  v  a  2 s. c  o m
}

Related Tutorials