We will prefer wifi networks over 3g networks if the user has enabled wifi
and is within range of a known network.  You can check if we are connected
to wifi via

NetworkInfo activeInfo = ConnectivityManager.getActiveNetworkInfo();
Boolean wifi = (activeInfo != null && activeInfo.getType() ==
ConnectiivtyManager.TYPE_WIFI);

There is no nice way to force a udp transmission onto wifi.


On Mon, Oct 21, 2013 at 8:04 AM, RLScott <[email protected]> wrote:

> My app uses a UDP network protocol involving very little data.  But the
> round-trip latency is important.  I have heard that 3G latency is more
> variable than wi-fi, especially after a long period of inactivity.  My app
> will use the network data after several hours of inactivity, and I want
> that very first access to have the shortest possible latency.  (It is
> querying a network time server).  I thought about sending out some nonsense
> UDP packets to some other host just to "wake up the channel", since I am
> told that the 3G network switches to faster response only after a few
> hits.  But then I thought it might be simpler just to insist that wi-fi be
> available to provide this particular function.  So is there anything in the
> API that allows me to either query if wi-fi is available, or to force the
> network access to use only wi-fi?
>
>
>  --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to