Skip to content

The project contains library for various kinds of validations which are used in apps.

Notifications You must be signed in to change notification settings

mohitrajput987/app-utility

Repository files navigation

App Utility

An android library which provides utility methods to perform various types of common actions in app i.e. validations, toasts, widget related utilities etc.

Integration

Add it to your build.gradle with:

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

and:

dependencies {
    compile 'com.github.mohitrajput987:app-utility:v1.1.0'
}

Simple to use like below:

if(CommonUtils.isNetworkAvailable(context)){
    // Call web service
}else{
    ToastUtils.showShortToast(context, R.string.network_not_available);
}
if(ValidationUtils.isEmailValid("example@domain.com")){
    // Perform task
}else{
    ToastUtils.showShortToast(context, R.string.invalid_email);
}

Types of util claases-

1. Validations-

Email, mobile, zipcode, name, url etc.

2. Toast-

Methods to show toast messages easiliy without writing much code.

3. Common-

Internet availability, max length, bitmap etc.

4. Location-

Location related methods.

5. Shared Preference -

Easy way to use shared preference in app.

Javadoc

You can read complete details about all classes and their methods in javadoc