Update 1
main.java file
//how would i return those errors on the main.java file? so that i can display on the UI.
directory_listings = obj.get_webpage_source();
end
I am new to Android mobile application development. I would like to know, how can I handle the exception like HttpConnection related exceptions or any other important exceptions.
i am thinking of top of my head:
server is down
file not exists
no data found
my code is here:
the below code is in its own java class and i am calling this code from main.java
public class Get_Webpage {
public String get_webpage_source(){
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(parsing_url);
HttpResponse response = null;
...............
...............
...............
}
}
you need to catch all the below exception when reading file from the web.