Skip to content

ValidationManager library allow to us that check phone number, credit card, email easily.

License

Notifications You must be signed in to change notification settings

serhatleventyavas/ValidationManager

Repository files navigation

ValidationManager

ValidationManager library allow to us that check phone number easily.

Features

  • 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:2.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 for details.

About

ValidationManager library allow to us that check phone number, credit card, email easily.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages