Monday, August 31, 2009

Android Code Snippet #1: Get own MSISDN

You can determine the MSISDN of the SIM card currently inserted into your GSM based phone as follows:
...
((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getLine1Number();
...

Only works if you are attached to the mobile network.