How to respect network use settings in Android
<p>My app performs some backgound data collection and I'm adding support for the user network preferences, such as performing background updates and data roaming.  I have the following checks already:</p>

<pre><code>ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if(cm.getBackgroundDataSetting()) {
...
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
if (networkInfo != null &amp;&amp; networkInfo.isAvailable() &amp;&amp; networkInfo.isConnected()) {
</code></pre>

<p>with the required entries in the manifest:</p>

<pre><code>&lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt;
&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"&gt;&lt;/uses-permission&gt;
</code></pre>

<p>This all appears to be working fine, but I was wondering if I should be checking anything else?  I was worried about checking for data roaming but the <a href="http://developer.android.com/reference/android/net/NetworkInfo.html#isAvailable%28%29" rel="nofollow">docs</a> state that <code>networkInfo.isAvailable()</code> checks this for me.  So are there any other checks I need to implement for network settings?  Anything else in this area I should be aware of?</p>
