tags:

views:

94

answers:

2

hi

i am developing android application website address how can implemented validation

example : www.yahoo.com

please forward some solution

A: 

Im assuming you want to check if a website exists

You could try this, make sure the android.INTERNET permission is selected in your manifest.

 String host = "http://www.yahoo.com/";
 int timeOut = 3000; // I recommend 3 seconds at least
 boolean status = InetAddress.getByName(host).isReachable(timeOut);
Con
sorry this solution is not use my application in java website validation then above code
+1  A: 

You should of expanded a little bit on what you said, your question was very confusing, you should of also mention you were using regex.

Try this:

^[A-Za-z0-9.\\-]+.[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,4}$

Con
thank u very much
this implementation working fine