I want to know the basic use of TelephoneNumberUtil
class in Android. I searched on that but in the Android I'm not able to get a proper answer. Can anyone explain me the exact use of this class?
What is the use of TelephoneNumberUtil class?
Asked Answered
Link in answer is dead - "Status Code:404 Not Found". –
Straighten
Here's a cached page copy from Internet Archive. It says that
TelephoneNumberUtil
class was removed in SDK v0.9. –
Confraternity According to the documentation public class PhoneNumberUtils
contains
various utilities for dealing with phone number strings
Simple answer
Format an international telephone number.
Detailed Answer
if you have number 1234567890
and you need format it US number format
to be like this
123-456-7890
then you should use formatNumber method
PhoneNumberUtils.formatNumbe(yourPhoneString);
Notice this method deprecated use instead formatNumber (String phoneNumber, String defaultCountryIso)
Reference
https://developer.android.com/reference/android/telephony/PhoneNumberUtils.html
© 2022 - 2024 — McMap. All rights reserved.
TelephoneNumberUtil
in Android SDK. – Confraternity