I have an Android app that downloads a JPG from a server every so often, and I need to be able to display a “Down for Maintenance” image whenever a certain file is present on the internet.
Example:
Phone checks for “yes.maint” or some other file on a web server – if present, it shows maintenance image instead of other image. If not present, load other image as normal.
Is this possible in Android?
Thanks
Assuming the file “yes.maint” or some of other file is accessible via HTTP, you could use HTTPClient and call execute to get the HTTPResponse. You then call getStatusLine() to check and get the status code for that from StatusLine getStatusCode(). If it is not found, hopefully you get 404 that you could use to check which image you have to load