Simple Android wrapper for Twilio's Phone Lookup API
TwilioLookup.setAuthorization("yourTwilioAccountSid", "yourTwilioAuthToken");
TwilioLookup.lookup("theNumberYouWantToLookup", new TwilioLookup.OnResponseCallback() {
@Override
public void onValidResponse(TwilioLookupResponse response) {
Log.d("TAG","Success, country code: "+response.getCountryCode()+" "+response.getCarrier().getName());
}
@Override
public void onInvalidResponse(Response response) {
Log.d("TAG","Failure, phone number is not valid, "+response.message());
}
@Override
public void onFailure(Throwable throwable) {
Log.e("TAG", "Error: " + throwable.toString());
}
});
See JitPack for more information.
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.jrejaud:TwilioLookup:v1.0'
}