is Chinese Mobile Phone number - Android Internationalization

Android examples for Internationalization:Chinese

Description

is Chinese Mobile Phone number

Demo Code

import android.content.Context;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.widget.TextView;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

public class Main{

    public static boolean isMobileNOToast(Context context, String mobiles) {

        if (!StringUtil.isNull(mobiles)) {
            Pattern p = Pattern
                    .compile("^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\\d{8}$");
            Matcher m = p.matcher(mobiles);
            if (m.matches()) {
                return true;
            } else {
                return false;
            }/*w w w .ja  v a2 s. com*/

        } else {
            return false;
        }

    }

}

Related Tutorials