Skip to content

Commit

Permalink
adds README
Browse files Browse the repository at this point in the history
  • Loading branch information
serhatleventyavas committed Feb 28, 2020
1 parent cdeae2d commit 120aa45
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ValidationManager
[![](https://jitpack.io/v/serhatleventyavas/ValidationManager.svg)](https://jitpack.io/#serhatleventyavas/ValidationManager)

ValidationManager library allow to us that check phone number easily.
### Features
- [x] Check phone number
- [ ] Check email address
- [ ] Check credit card
###Setup

------------

### Step 1. Add the JitPack repository to your build file
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 {
implementation 'com.github.serhatleventyavas:ValidationManager:1.0'
}
```
### Step 3. Get All Countries
If you want retrieve countries, you can follow below code block.
```
val jsonParser: JsonParser = JsonParser(context)
val jsonArrayResult: JSONArray = jsonParser.readDataFromRawFile()
val countryList: ArrayList<Country> = jsonParser.parseCountry(jsonArrayResult)
```

### Step 4. Check Phone Number
If you want to check phone number by specific country, you can follow below code.
```
// for example Turkey country
val country: Country = countryList[0]
val result: Boolean = PhoneValidation.validPhoneNumber(country, "+90", "5551231233")
```

## License

ValidationManager is released under the MIT license. [See LICENSE](https://github.com/serhatleventyavas/ValidationManager/blob/master/LICENSE) for details.

0 comments on commit 120aa45

Please sign in to comment.