1. 程式人生 > >BankCardUtils 根據銀行卡號 獲取 銀行卡型別、銀行名稱和銀行編碼 自動格式化銀行卡號、手機號、身份證號輸入的工具類

BankCardUtils 根據銀行卡號 獲取 銀行卡型別、銀行名稱和銀行編碼 自動格式化銀行卡號、手機號、身份證號輸入的工具類

BankCardUtils

專案地址:nanchen2251/BankCardUtils 

簡介:根據銀行卡號 獲取 銀行卡型別、銀行名稱和銀行編碼 自動格式化銀行卡號、手機號、身份證號輸入的工具類

更多:作者   提 Bug   

標籤:

 

根據銀行卡號 獲取 銀行卡型別、銀行名稱和銀行編碼 自動格式化銀行卡號、手機號、身份證號輸入的工具類

號外:聽說「nanchen」搞了一個 Android 開發者的免費福利,不行你看:給 Android 開發者的一點福利:免費模擬面試

效果圖

⊙開源不易,希望給個 star 或者 fork 獎勵

⊙擁抱開源:https://github.com/nanchen2251/

⊙交流群(拒絕無腦問):118116509 Android 神技側漏交流群( 點選圖示即可加入 )

特點

  • 支援自動根據銀行卡號獲取出銀行名稱、銀行編碼、銀行卡型別
  • 銀行相關資訊都比較全,無需每次去都 xls 型別的 bin 檔案
  • 支援自動格式化手機號、身份證號、銀行卡號輸入
    • 手機號:xxx xxxx xxxx
    • 身份證號:xxxxxx xxxx xxxx xxxx
    • 銀行卡號:xxxx xxxx xxxx xxxx

使用方法

1、新增依賴

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

Step 2. Add the dependency

dependencies {
            compile 'com.github.nanchen2251:BankCardUtils:1.0.2'

    }

2、使用方式最好參照 demo 

BankInfoUtil mInfoUtil = new BankInfoUtil(cardNum); // 把銀行卡號作為引數傳入
String bankName = mInfoUtil.getBankName(); // 可以獲取銀行名稱
String bankId = mInfoUtil.getBankId();  // 可以獲取銀行編碼
String bankCardType = mInfoUtil.getCardType(); // 可以獲取卡片型別

關於作者

南塵<br>
四川成都<br>
[其它開源](https://github.com/nanchen2251/)<br>
[個人部落格](https://nanchen2251.github.io/)<br>
[簡書](http://www.jianshu.com/u/f690947ed5a6)<br>
[部落格園](http://www.cnblogs.com/liushilin/)<br>
交流群:118116509<br>
歡迎投稿(關注)我的唯一公眾號,公眾號搜尋 nanchen 或者掃描下方二維碼:<br>
![](http://images2015.cnblogs.com/blog/845964/201707/845964-20170718083641599-1963842541.jpg)

1024 - 夢想,永不止步!
愛程式設計 不愛 Bug
愛加班 不愛黑眼圈
固執 但不偏執
瘋狂 但不瘋癲
生活裡的菜鳥
工作中的大神
身懷寶藏,一心憧憬星辰大海
追求極致,目標始於高山之巔
一群懷揣好奇,夢想改變世界的孩子
一群追日逐浪,正在改變世界的極客
你們用最美的語言,詮釋著科技的力量
你們用極速的創新,引領著時代的變遷

------至所有正在努力奮鬥的程式猿們!加油!!

Licenses

 Copyright 2017 nanchen(劉世麟)

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.