Tag Archives: TelephonyManager

Find subscriber id, sim serial number, phone network type etc in Android

By | March 20, 2017

The android.telephony.TelephonyManager class provides information about the telephony services such as subscriber id, sim serial number, phone network type etc.You can also determine the phone state etc. Permission Before Starting, make sure you add the permission in the Android Manifest. [xml] <uses-permission android:name="android.permission.READ_PHONE_STATE"/> [/xml] Android Source Code Below code gets the information from the Android Telephony Manager and… Read More »

Get Unique deviceID in android? – Different Methods

By | August 8, 2011

Hello everyone.. I have shown one way to get the deviceID in android in this post. Here are some other ways by which you can get the unique device ID of an android device. First Method… [java] String deviceId = Settings.System.getString(getContentResolver(),Settings.System.ANDROID_ID); [/java] Second Method [java] String deviceId = Secure.getString(this.getContext().getContentResolver(), Secure.ANDROID_ID); [/java] Third Method [java] final TelephonyManager tm =… Read More »

How to get notified during an incoming call and get that number inside your program in ANDROID?

By | April 24, 2011

Hi all……. In today’s tutorial I will show you how to get the incoming phone number inside your application. In many situation we may need this. For this we need to have BoradCastReceivers. Inside this class we create an object of the TelephonyManager class ang register with the sytem service.Now we have to make another class which extends… Read More »

Get my Telephone number in ANDROID

By | October 5, 2010

Gets the phone number the app is running on. It needs a permission so add the line uses-permission android:name=”android.permission.READ_PHONE_STATE” to the manifest.xml [java] private String getMyPhoneNumber(){ TelephonyManager mTelephonyMgr; mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); return mTelephonyMgr.getLine1Number(); } private String getMy10DigitPhoneNumber(){ String s = getMyPhoneNumber(); return s.substring(2); } [/java]