Android EditText Validation – Library

Published by Kapil Mohan on

Link: https://github.com/vekexasia/android-edittext-validator

  • Needs to add an extra schema in root layout :
  • whatever:testType can be replaced with options from options tab for validation

  • regexp: for custom regexp
  • numeric: for an only numeric field
  • alpha: for an alpha only field
  • alphaNumeric: guess what?
  • email: checks that the field is a valid email
  • creditCard: checks that the field contains a valid credit card using Luhn Algorithm
  • phone: checks that the field contains a valid phone number
  • domainName: checks that field contains a valid domain name
  • ipAddress: checks that the field contains a valid ip address
  • webUrl: checks that the field contains a valid url
  • personName: checks if the entered text is a person first or last name.
  • personFullName: checks if the entered value is a complete full name.
  • date: checks that the field is a valid date/datetime format ( if customFormat is set, checks with customFormat )
  • numericRange: checks that the field is a valid value between integers. (minNumber and maxNumber must be set)
  • floatNumericRange: checks that the field is a valid value between integers (but decimal values are allowed). (minNumber and maxNumber must be set)
  • nocheck: It does not check anything except the emptyness of the field.

You can customize them using the attributes

  • testErrorString used when the field does not pass the test
  • emptyErrorString used when the field is empty

Android EditText Validation library is an extension of editText for providing Validation functionality.

for more details:- https://github.com/vekexasia/android-edittext-validator

Library Details:

  • Language: Java
  • current Version: 1.3.5
  • License: MIT

Kapil Mohan

Like to add color to developers life and apps. Can create smile using Android, iOS, PHP, codeignitor, web technologies, etc... Feel free to contact me at [email protected] .