• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Best place to put code relating to connectivity issues...?

rpgmaker

Newbie
Sep 16, 2010
25
1
Good afternoon,

What is the best way to deal with connectivity issues (no data or wifi enabled, wifi or data enabled but no internet, possibly timeouts, etc)? Right now I'm putting code dealing those scenarios in each separate activity (that uses data) but it occurred to me that maybe there is a design pattern (that I don't know about) that describes a way of putting this code in just one place of the app instead of having to repeat it? I've looked around and haven't found anything. It's not that much code but the fact that I have to repeat it bothers me. Any suggestion would be appreciated.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones