Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 1.86 KB

README-EN.md

File metadata and controls

58 lines (44 loc) · 1.86 KB

PhoneNumber

A library which can get phone number geo location and other infomation from local or network (baidu, juhe or custom api).

Build Status build status JAR Download

Download

Grab via gradle

dependencies {
    compile 'org.xdty.phone.number:phone-number:0.6.11'
}

or maven

<dependency>
  <groupId>org.xdty.phone.number</groupId>
  <artifactId>phone-number</artifactId>
  <version>0.6.11</version>
  <type>aar</type>
</dependency>

or JAR from maven central

Usage

1. Add meta-data to AndroidManifest

<meta-data
    android:name="org.xdty.phone.number.API_KEY"
    android:value="YOUR_API_KEY"/>

You can get YOUR_API_KEY from Baidu apistore's usercenter

2. Add these lines to MainActivity, For more details, see example and CallerInfo

new PhoneNumber(this, new PhoneNumber.Callback() {
    @Override
    public void onResponse(INumber number) {
        // Do your jobs here
        textView.setText(number.getName());
    }

    @Override
    public void onResponseFailed(INumber number) {
    }
}).fetch("10086", "10000", "10001", "OTHER_PHONE_NUMBER");