I work in Android development for more than 4 years and in all the projects I was involved, people always asked me which is the best way to handle No Internet connection use-case. Checking it can be done in multiple ways, but I am still trying to decide what could be the best User experience ever.
One idea could be having an observer to check the internet connection and everytime it's lost, to show an activity over your current screen in order to inform the user that he lost connection. When the internet it's back, just call finish on that activity. But this blocks any interaction with the app.
Another one would be to personalize every screen of your app to show a customized No connection layout. But this can cost you a lot of work if you have more than 20 screens.
What do you think it's the best way to handle No internet connection in an Android app?
According to material.io you can show a cardview
with your desired views informing the user of the current network state. This way, a user is not blocked from interacting with the app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With