Question

I would like to measure the traffic rate in Android with android.net.TrafficStats. The documentation says, there is a getUidTcpTxBytes() and a getUidUdpTxBytes() function in this class. These ware added in API level 8. I'm using API level 8, but I can not find these functions, only some of them like getTotalRxBytes().

What could be the problem?

Était-ce utile?

La solution

getUidTcpTxBytes() was added in API Level 12, as was getUidUdpTxBytes(). You can tell this by viewing the methods in the JavaDocs and seeing the "Added in API level 12" notation, on the right side of the gray bar that houses the method signature.

Autres conseils

Look closer: getUidTcpTxBytes() was added in API Level 12, as well as getUidUdpTxBytes(). Actually most of them were added after API Level 12 and 14.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top