diff --git a/README.md b/README.md index 686d2dc..68c61d7 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,6 @@ Just some handy static classes/methods for dealing with common Android tasks. * `NetUtils` - Static methods for getting/posting JSON, posting form-encoded data, opening and listening to UDP sockets. Handles background threading on behalf of the user, while providing listeners/callbacks that will execute user-provided code on the main thread. Also contains some helper methods for URL encoding, checking conenctivity status on the device and generating random Strings (as non-unique IDs for Http logs etc.). * `SharedPrefsUtils` - Static methods for reading & writing to & from `SharedPreferences`. Methods are provided for each type that can be read/written, and just obfuscates some of the boiler-plate associated with `SharedPreferences`. Only uses __Default__ `SharedPreferences` at the current point in time. + +* `EmailUtils` - A helper class that can be used to authenticate emails during user login or sign-up. + diff --git a/src/com/esri/android/util/EmailUtils.java b/src/com/esri/android/util/EmailUtils.java new file mode 100644 index 0000000..3b2afac --- /dev/null +++ b/src/com/esri/android/util/EmailUtils.java @@ -0,0 +1,24 @@ +package com.esri.android.util; + +/** + * A pack of helpful Email utility methods. + */ + +public class Email { + + /** + * + * Helper method is e-mail for check. + * + * @param target Check e-mail valid and invalid. + * @return true or false valid mail. + */ + public static boolean isValidEmail(CharSequence target) { + if (target == null) { + return false; + } else { + return android.util.Patterns.EMAIL_ADDRESS.matcher(target).matches(); + } + } + +}