ERNICommunity / erni-moods-android

Android ERNI moods app (Hack Sessions)
0 stars 0 forks source link

Programatically obtain the users phone number #29

Closed guslong closed 9 years ago

guslong commented 9 years ago

It should be possible in some cases (but not all!) to get the users mobile phone number programatically and populate the signup form already with that number... a nice little enhancement if it works.

TelephonyManager telephonyManager = (TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE); String phoneNumber = telephonyManager.getLine1Number();

guslong commented 9 years ago

Turns out to be not such a great feature. Only works if the phone number is stored in the SIM card, and only with certain providers. Doesn't work on my Swisscom Samsung Galaxy. Possible wontfix.