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?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top