Visit GitHub RepoValidation

A utility library that does the following things:

  • Check internet connection
  • Validate for empty edit texts
  • Validate for email
  • Validate for mobile number
  • Validate text for any no of digits
  • Fancy Progress Dialog

Watch it in action here

How to add

Add this in the project level build.gradle:

                  maven { url '' }

And this in the app level build.gradle

compile 'com.github.shree-vastava:ValidUtil:v1.0'

How to use

Create an object of the ValidUtils class

    ValidUtils validUtils = new ValidUtils() 

Check for internet connection

    if (validUtils.isNetworkAvailable(this)){
        // do whatever you want to do IF internet is AVAILABLE

Check for empty EditTexts

    if(validUtils.validateEditTexts(name,mobile,email)){ //where name,mobile, email are EditTexts
        // do whatever you want to do if EditTexts are not empty

Check for Email validation

         // do whatever you want to do if email is valid i.e in form of something@somedomain.someextension

You can check for more email EditTexts also by passing comma separate EditTexts in the above function

Check for mobile Number

         // do whatever you want to do if mobile number is valid i.e 10 digits

You can check for multiple mobile EditTexts

Check for no of digits in an EditText

         // do whatever you want to do if Pin is 6 digits

Here Pin the EditText

Show and hide Fancy Progress Dialog


where the arguements are like

   validUtils.showProgressDialog(Context, Activity)

To hide the dialog


The last and simplest as well as bonus functionality

The Toast

  validUtils.showToast(Context,"some message")
Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer

Become Pro in Android by watching videos