I wanted to ask a practical question about checking for network connection,
which is probably a simple question. I am sure this is an easy question.
I'm looking at this:
"Before your app attempts to connect to the network, it should check to see
whether a network connection is available using getActiveNetworkInfo()<http://developer.android.com/reference/android/net/ConnectivityManage...>
This is in context of doing 10s of networks calls on multiple threads to
retrieve small files (about 20K) over http.
In practice, is there any cost for making this call? Does it initiate a
network operation or stay on the device? What percentage of the time is it
actually wrong? Would it be actually faster to see if one of my http
operations gets a sockettimeoutexception or a connectiontimeoutexception?
Based on that webpage, it calls isConnected() on a UI thread, just before
explaining that "network operations can involve unpredictable delays" and
should be done. Does that mean that isConnected() is a short and
predictable delay, or should I not read that much into it?
In one of the battery life classes at I/O, they talked about how the 3G
radio takes a bit to warm up, and that you might as well do a bunch of
network traffic while it is warm (paraphrasing a bit). Does simply calling
isConnected() warm up that radio?