Here's a common problem I'm facing in Android: sometimes it automatically connects to a network when the signal is very low or there is a problem with the network itself and there is no Internet connectivity available at that moment.

I would like to find an solution which would automatically disconnect from the wi-fi network if it detects a problem with the Internet connection.

Anybody have any advice?