http://developer.android.com/sdk/android-4.0.html

>>>
Also beware that|getBackgroundDataSetting() <http://developer.android.com/reference/android/net/ConnectivityManager.html#getBackgroundDataSetting%28%29>|is now deprecated and always returns true---use|getActiveNetworkInfo() <http://developer.android.com/reference/android/net/ConnectivityManager.html#getActiveNetworkInfo%28%29>|instead. Before you attempt any network transactions, you should always call|getActiveNetworkInfo() <http://developer.android.com/reference/android/net/ConnectivityManager.html#getActiveNetworkInfo%28%29>|to get the|NetworkInfo <http://developer.android.com/reference/android/net/NetworkInfo.html>|that represents the current network and query|isConnected() <http://developer.android.com/reference/android/net/NetworkInfo.html#isConnected%28%29>|to check whether the device has a connection. You can then check other connection properties, such as whether the device is roaming or connected to Wi-Fi.
<<<

-- Kostya

07.01.2012 11:06, Beth ?????:
The background data setting might change for all apps with a quota or for a single app that is using more than the user would like. The background data setting that was once a simple boolean is now a complicated data structure.
"Does the OS gives some kindof notification or does the app just stop?"

It looks like the system will continue to send the "ACTION_BACKGROUND_DATA_SETTING_CHANGED" broadcast. With the new user interface, the setting change may or may not apply to your app. Maybe there are extras in the broadcast that can read the setting and store it in a db or preference. If there are extras, and I doubt there are extras, the app could use the intent to work out whether or not that change is being made on your app or all apps or a different app. Without extras, the app should just use the network info methods when it starts/resumes and every time the setting changes. The thing to do would be to listen for the broadcast and tear down an active connection if the network info object returned by the network info methods does not allow the app to continue to connect.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to