Last active
March 2, 2016 15:11
-
-
Save osama-raddad/c4a0356b839293eb305d to your computer and use it in GitHub Desktop.
get phone number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get phone number | |
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); | |
String imei = tm.getDeviceId(); | |
String tel = tm.getLine1Number(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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