I use NetworkInfo.isConnected()
to determine if my app can make a web request:
public boolean isConnected() {
ConnectivityManager connectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo();
activeNetwork != null && activeNetwork.isConnected();
}
After the addition of Data Saver in Android N, is this method still reliable. In other words, if my app is restricted in the background on a metered network will isConnected()
still return true?