Is there any way to detect the network breakage or weaker network, using Java?
you can intermittently test a http connection to a known host such as google and detect ConnectionExceptions
URLConnection con = new URL("http://www.google.com/").openConnection();
con.setUseCaches(false);
con.setAllowUserInteraction(false);
while(true)
{
try
{
con.connect();
con.getContentType(); // just to make sure the connection works
// sleep for some interval
}
catch(IOException e)
{
// handle and break
}
}