You can perform an HTTP GET and if the response code is 404 or if you
get a timeout, then the page is down. HTTP Head might also prove
useful for you.

You should be able to specify the timeout period too so that you dont
wait too long.

Eddie

On Jun 29, 7:28 am, Kenneth WON <kenneth...@gmail.com> wrote:
> Hi, all,
>
> I have an app, which needed to communicating with the web server
> (which hold by myself). Sometimes, the server will down.
> Now, what I want to know is: How can I get a signal which indicating
> the web server is down?
>
> When I using this:
> HttpResponse httpResponse = new
> DefaultHttpClient().execute(httpRequest);
>
> if the web server is down, it will throw an IOException, I can get a
> signal.
> However, the responding time of the above method is very long.
> Is there any other methods?
>
> Thanks for your help!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to