Skip to content

Instantly share code, notes, and snippets.

@osama-raddad
Last active March 2, 2016 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osama-raddad/c4a0356b839293eb305d to your computer and use it in GitHub Desktop.
Save osama-raddad/c4a0356b839293eb305d to your computer and use it in GitHub Desktop.
get phone number
//get phone number
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String imei = tm.getDeviceId();
String tel = tm.getLine1Number();
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment