android TrafficStats getUidRxBytes inaccurate

后端 未结 2 1681
时光说笑
时光说笑 2021-01-14 08:53

I write a little android app, sends Http request, receives response from server, and count how many bytes transmitted and received. and the code is simply as follow

2条回答
  •  醉酒成梦
    2021-01-14 09:40

    From my understanding, you should combine getUidRxBytes with getUidRxPackets.

    You should have something like : getUidRxBytes = getUidRxPackets * (tcp/ip header size)

提交回复
热议问题