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.