Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8709805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:27:37+00:00 2026-06-13T04:27:37+00:00

There is iOS US2FormValidator library for user input validation (see the picture below). I

  • 0

There is iOS US2FormValidator library for user input validation (see the picture below). I think that library is better than the default of just popping an alert when something doesn’t validate.

US2FormValidator Preview

I’m looking for how to do such things on Android. Are there some Android analogs of US2FormValidator?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:27:38+00:00Added an answer on June 13, 2026 at 4:27 am

    The pop-up effect you have shown on your screenshot can be achieved using Android’s built-in setError(String) method on EditText widgets.

    Also, you can leverage the power of annotations using the Android Saripaar library that I’ve authored.

    first add the library:

    compile 'com.mobsandgeeks:android-saripaar:2.0.2'
    

    The library is very simple to use. In your activity annotate the View references you would like to validate as in the following example.

    @Order(1)
    private EditText fieldEditText;
    
    @Order(2)
    @Checked(message = "You must agree to the terms.")
    private CheckBox iAgreeCheckBox;
    
    @Order(3)
    @Length(min = 3, message = "Enter atleast 3 characters.")
    @Pattern(regex = "[A-Za-z]+", message = "Should contain only alphabets")
    private TextView regexTextView;
    
    @Order(4)
    @Password(min = 6, scheme = Password.Scheme.ALPHA_NUMERIC_MIXED_CASE_SYMBOLS)
    private EditText passwordEditText;
    
    @Order(5)
    @ConfirmPassword
    private EditText confirmPasswordEditText;
    

    The order attribute specifies the order in which the fields have to be validated.

    In your onCreate() method instantiate a new Validator object. and call validator.validate() inside any of your event listeners.

    You’ll receive callbacks on onSuccess and onFailure methods of the ValidationListener.

    If you want to show a pop-up as show in the image above then do the following,

    public void onValidationFailed(View failedView, Rule<?> failedRule) {
        if (failedView instanceof Checkable) {
            Toast.makeText(this, failedRule.getFailureMessage(), Toast.LENGTH_SHORT).show();
        } else if (failedView instanceof TextView) {
            TextView view = (TextView) failedView;
            view.requestFocus();
            view.setError(failedRule.getFailureMessage());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an AIR application that I'm compiling to mobile. There is an iOS
There are a lot of iOS apps in the iTunes Store that, upon launch,
Is there some free and easy to use 3D library for iOS (and Android)
In iOS there are two C structs that denote paths that describe drawable shapes:
There is a iOS Developer Library for Objective-C. This library include a overview of
I know that in iOS 5 there is automatic reference counting which takes away
For iOS there are companies such as Flurry that give you analytics for your
Is there any iOS Storyboard equivalent for Android development? iOS Storyboard is fantastic that
I would like to know if there's an iOS library or framework for loading
Is there an iOS 5 arc compatible lazy Image loading library? I've not found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.