Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the best way to handle No internet connection in an Android App [closed]

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?

like image 766
sunlover3 Avatar asked Aug 01 '19 21:08

sunlover3


1 Answers

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. enter image description here

like image 109
Taseer Ahmad Avatar answered Sep 22 '22 20:09

Taseer Ahmad