根据手机号码查询归属地、运营商我们引用google的libphonenumber包,libphonenumber是用于解析、格式化、存储和校验电话号码的Java、C++或JavaScript类库。
依赖jar包:com.googlecode.libphonenumber(Libphonenumber、Geocoder、Prefixmapper、Carrier)
jar包下载地址:http://mvnrepository.com/search?q=libphonenumber(我们也可以使用maven配置)
package com.yuanzubao.common.util;
import java.util.Locale;
import com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder;
/**
* 手机