Android : How to fastly check if URL server is available

on Friday, September 12, 2014


I have some URL in the form



http://www.mywebsite.com/util/conv?a=1&from=%s&to=%s


and want to check if are availables.


The links give redirect me on a bad request page if I try to open these with a browser, however via code I can get the data that I need


Use a try catch block on Http request procedure is pretty slow, so I'm wondering how I could ping a similar address to check if its server is active.


I have tried



boolean reachable = InetAddress.getByName(myLink).isReachable(6000);


but returns always false


Someone could help me?


0 comments:

Post a Comment