I want to determine if the Wifi is being used currently.

AFAIK, Wifi can be in a "connected" state, but there need not be any
data being transferred currently.

I can get whether the Wi-fi is connected or not by doing this:

--------------------------------------------------------------------------------------------------------------------------------
android.net.ConnectivityManager         pCM =
(android.net.ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
                        if(null != pCM)
                        {
                                NetworkInfo             aNI =
pCM.getNetworkInfo(android.net.ConnectivityManager.TYPE_WIFI);
                                if(null != aNI)
                                {
                                        NetworkInfo.DetailedState       aDS = 
aNI.getDetailedState();

                                        if(NetworkInfo.DetailedState.IDLE == 
aDS ||
NetworkInfo.DetailedState.FAILED == aDS ||
                                                        
NetworkInfo.DetailedState.DISCONNECTED == aDS ||
NetworkInfo.DetailedState.SUSPENDED == aDS)
                                        {
                                                WifiManager                     
theWiFi =
(WifiManager)getSystemService(WIFI_SERVICE);

                                                if(null != theWiFi)
                                        {
                                                        // do something         
                        }
}
                                        else
                                        {
                                                // do something
                                        }
                                }
                        }
--------------------------------------------------------------------------------------------------------------------------------

But I am not able find an API if the Wifi data transfer is happening.
Is there any way I can know this?

Thanks



-- 
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