On Tue, Jan 17, 2012 at 12:25 AM, Putti Me <[email protected]> wrote: > getTotalRxBytes() + getTotalTxBytes() gives me the total bytes transferred. > > Does this include all data i.e. > > mobile > wifi > bluetooth > anything else
I suspect that it does not include Bluetooth. I would expect that it only handles WiFi and mobile data. You would need to examine the source code to confirm this. > I can get the individual usage for mobile by using getMobileRxBytes and > getMobileTxBytes. > > To get wifi usage, will the following code work? > ------------------------------------------------------------------------------------ > long b1 = getMobileRxBytes() + getMobileTxBytes(); > long b2 = getTotalRxBytes() + getTotalTxBytes(); > > long wifi_usage = b2 - b1; // is this correct? > ------------------------------------------------------------------------------------ It is a reasonable estimate. > Is there any other way of getting the individual usage for WiFi only? I hope not. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.7 Available! -- 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

