6

Probably missing something dumb, I'm guessing I need to add some code. But I added the following jar file to my project. The user enters a phone number and I'm able to retrieve the country phone code, but I want to retrieve the country name as well as the 2 letter ISO country code.

PhoneNumberOfflineGeocoder should do that with it's getCountryNameForNumber(PhoneNumber number, Locale language) method should do that. But I can't figure out how to import that class properly.

Vadim Kotov
8,2848 gold badges51 silver badges63 bronze badges
asked Nov 11, 2014 at 6:13

2 Answers 2

10

You need to include another jar from here. PhoneNumberOfflineGeocoder is not in libphonenumber-7.0.jar.

answered Nov 11, 2014 at 7:23
Sign up to request clarification or add additional context in comments.

Comments

2

Use this in gradle file:

 // https://mvnrepository.com/artifact/com.googlecode.libphonenumber/geocoder
 implementation 'com.googlecode.libphonenumber:geocoder:#'
answered Feb 8, 2020 at 10:49

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.