I want to check internet connection when device is connected to a network but that doesnt have internet connection. I want to know what is the best way for checking this
I asked this question because didn't find any accept answer is SO. here are some duplicate questions but there isn't one accept answer:
Java: Internet connectivity check via ping to google not working
Check for Active internet connection Android
also two questions that has accepted answer, the answers are not working fine: