Hello,

whats the best way to detect that the App is able to download data
from somewhere ?

At the mo. is do something like this:

        public static boolean isNetworkReachable(final Context _context)
        {
                final ConnectivityManager systemService = (ConnectivityManager)
_context
                                .getSystemService(Context.CONNECTIVITY_SERVICE);

                /**
                 * Avoid NullPointerException when offline
                 */
                if (systemService.getActiveNetworkInfo() == null)
                {
                        Log.i(LOG_TAG, "Network not reachable");
                        return false;
                }

                final State networkState =
systemService.getActiveNetworkInfo().getState();
                final boolean isRoamingNow =
systemService.getActiveNetworkInfo().isRoaming();


Anyone else can point me to a better way to do it ?

thx,
Jens


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

Reply via email to