Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.regex.Pattern; public class Main { public static boolean checkUrl(String url) { if (TextUtils.isEmpty(url)) { return false; } return Pattern.compile("^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]") .matcher(url).matches(); } }