I tried this myself and ran into a few issues, firstly to call the TelephonyManager members you need to add a permission to the android manifest
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Also you may find that outside the emulator that getLine1Number returns an empty string.
For an explanation see this link, but in a nutshell the sim card does not know its number but can make an educated guess.
groups.google.com/group/android-develope...294350ea14e?lnk=raot
So you can call this function if you want to add the permission, but make sure you test the result before confidently displaying the results!