Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Calling networkInfo.isConnected()
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robert Greenwalt  
View profile  
 More options Jul 23 2012, 8:38 pm
From: Robert Greenwalt <rgreenw...@google.com>
Date: Mon, 23 Jul 2012 17:38:34 -0700
Local: Mon, Jul 23 2012 8:38 pm
Subject: Re: [android-developers] Re: Calling networkInfo.isConnected()

In versions 4.0 and greater, if you app has background data turned off (by
the user) AND you are in the background and ask for the current active
network and check if it's connected, you will find it's not connected
(it'll be BLOCKED).  In fact, if you try to access the network you will
fail.

If either your background data setting is off OR you are in the foreground
you will be told you are connected (provided a connection, of course).

Before 4.0 there wasn't strict data enforcement - the data background stuff
was a suggestion that was not enforced.  Also the network status reported
was not app-specific.

I think that doing the calls you suggested should provide the correct
answer both pre-V4 and post-V4.  Not doing the calls just means you may
fail after spending alot of time and energy setting up network comms.

If you want to put up a different notice if they are explicitly blocked by
a user policy, you can watch for NetworkInfo.DetailedState.BLOCKED.

Let me know if you still think this is a problem.  We want to make APIs
that work for everybody.

R

On Mon, Jul 23, 2012 at 5:24 PM, Nathan <nathan.d.mel...@gmail.com> wrote:

> On Monday, July 23, 2012 2:44:51 PM UTC-7, Kostya Vasilyev wrote:

>> It's also a good way to check if the user disabled network connectivity
>> (i.e. the "mobile data" toggle), and starting with Android 4.0, this is
>> also affected by the "allow apps to perform background sync" system setting.

>> -- K

> REALLY?

> It was all good news and I was set to use it until now. But now I could be
> creating a support nightmare on 4.0.

> That *would* make sense, if "background sync" were the only possible thing
> that an app would use the internet for.
> It *would* make sense if a user sees "no internet connection " in an app,
> and immediately thinks, "oh, that must be because I disabled background
> synching". Not likely. More likely, they'll forget they ever used that
> setting and we will exchange ten emails.

> Maybe I misunderstand what "allow apps to perform background sync" is for.
> But I guarantee users will too.

> Nathan

> Nathan

> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.