package org.xdty.example;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.TextView;

import org.xdty.phone.number.PhoneNumber;
import org.xdty.phone.number.model.Number;
import org.xdty.phone.number.model.NumberInfo;
import org.xdty.phone.number.model.ResponseHeader;

import java.util.List;

public class MainActivity extends AppCompatActivity {

    public final static String TAG = MainActivity.class.getSimpleName();

    TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView = (TextView) findViewById(R.id.text);

        new PhoneNumber(this, new PhoneNumber.Callback() {
            @Override
            public void onResponseOffline(NumberInfo numberInfo) {
            }

            @Override
            public void onResponse(NumberInfo numberInfo) {
                // Do your jobs here
                textView.setText(numberInfo.toString());

                List<Number> numbers = numberInfo.getNumbers();
                for (Number number : numbers) {
                    Log.d(TAG, number.getNumber() +
                            ": " +
                            number.getType().getText() +
                            ", " +
                            number.getName() +
                            ", " +
                            number.getCount());
                }
            }

            @Override
            public void onResponseFailed(NumberInfo numberInfo) {
                if (numberInfo != null) {
                    ResponseHeader responseHeader = numberInfo.getResponseHeader();
                    if (responseHeader != null) {
                        textView.setText(responseHeader.getStatus());
                    }
                } else {
                    Log.e(TAG, "numberInfo is null");
                }
            }
        }).fetch("10086", "10000", "10001", "02151860253", "4001001673", "-1", "-2", "550", "551", "559", "569");
    }

}

package org.xdty.example;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.TextView;

import org.xdty.phone.number.PhoneNumber;
import org.xdty.phone.number.model.INumber;

public class MainActivity extends AppCompatActivity {

    public final static String TAG = MainActivity.class.getSimpleName();

    TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView = (TextView) findViewById(R.id.text);

        new PhoneNumber(this, new PhoneNumber.Callback() {
            @Override
            public void onResponseOffline(INumber number) {
            }

            @Override
            public void onResponse(INumber number) {
                // Do your jobs here
                String s = number.getNumber() +
                        ": " +
                        number.getType().getText() +
                        ", " +
                        number.getName() +
                        ", " +
                        number.getCount() +
                        " : " +
                        number.getProvince() + " " + number.getCity() + " " + number.getProvider();
                textView.setText(s);
                Log.d(TAG, s);
            }

            @Override
            public void onResponseFailed(INumber number) {
            }
        }).fetch("10086");
        // "10086", "10000", "10001", "02151860253", "4001001673", "-1", "-2", "550", "551", "559", "569"
    }

}

update example