There are several ways to handle no internet connection exception. But they didn't fit at all. That is all I get from my experience but not good at all.
- Handling exception handling when an error occurs
- When handling SocketException, it caches all networking exception even it's about HTTP error or no internet connection.
- Using Connectivity
- It only assumes wifi or mobile data is enabled or disabled.
- Mixing Connectivity with pinging or data connection checker package
- This was a good idea but when I release my app lot's of users complain about my app says "no internet connection even though they have internet"
- Pinging to google
- If users from google banned country for example in China. This approach will become useless.
So I think we need a good design pattern or something on that problem. What is the proper way to handle this error?