import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder class not found
Asked Answered
B

2

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.

Blackford answered 11/11, 2014 at 6:13 Comment(0)
A
10

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

Andra answered 11/11, 2014 at 7:23 Comment(0)
U
2

Use this in gradle file:

    // https://mvnrepository.com/artifact/com.googlecode.libphonenumber/geocoder
    implementation 'com.googlecode.libphonenumber:geocoder:#'
Ultimate answered 8/2, 2020 at 10:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.