I need to determine the national carrier code (not the country code) of any phone number, using libphonenumber Java SDK. How can I do this?
This should help your case - PhoneNumberToCarrierMapper
In the PhoneNumberToCarrierMapper class there is a method:
String getNameForValidNumber(PhoneNumber number, Locale languageCode)
This should give your the carrier code.
You can see the source code of that method in the related GitHub repository here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With