Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xdtianyu/phonenumber
一个获取号码归属地和其他信息(诈骗、骚扰等)的开源库 [重构中]
https://github.com/xdtianyu/phonenumber
Last synced: 1 day ago
JSON representation
一个获取号码归属地和其他信息(诈骗、骚扰等)的开源库 [重构中]
- Host: GitHub
- URL: https://github.com/xdtianyu/phonenumber
- Owner: xdtianyu
- License: apache-2.0
- Created: 2015-12-14T13:32:44.000Z (almost 9 years ago)
- Default Branch: legacy
- Last Pushed: 2020-03-25T14:34:45.000Z (over 4 years ago)
- Last Synced: 2023-11-13T09:38:31.449Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 1.41 MB
- Stars: 235
- Watchers: 11
- Forks: 44
- Open Issues: 1
-
Metadata Files:
- Readme: README-EN.md
- License: LICENSE
Awesome Lists containing this project
README
# PhoneNumber
A library which can get phone number geo location and other infomation from local or network (baidu, juhe or custom api).[![Build Status](https://travis-ci.org/xdtianyu/PhoneNumber.svg?branch=master)](https://travis-ci.org/xdtianyu/PhoneNumber)
[![JAR](https://img.shields.io/maven-central/v/org.xdty.phone.number/phone-number.svg)](http://central.maven.org/maven2/org/xdty/phone/number/phone-number/)
[![Download](https://api.bintray.com/packages/xdtianyu/maven/phone-number/images/download.svg)](https://bintray.com/xdtianyu/maven/phone-number/_latestVersion)## Download
Grab via gradle
```groovy
dependencies {
compile 'org.xdty.phone.number:phone-number:0.6.11'
}
```or maven
```xml
org.xdty.phone.number
phone-number
0.6.11
aar```
or JAR from [maven central](http://central.maven.org/maven2/org/xdty/phone/number/phone-number/)
## Usage
1\. Add `meta-data` to `AndroidManifest`
```xml
```
You can get `YOUR_API_KEY` from [Baidu apistore's usercenter](http://apistore.baidu.com/astore/usercenter)
2\. Add these lines to `MainActivity`, For more details, see [example](https://github.com/xdtianyu/PhoneNumber/tree/master/example) and [CallerInfo](https://github.com/xdtianyu/CallerInfo)
```java
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");
```