开发者

Broadcast intent for Data Tx and Rx for an App in Android device

I would like to know:

1) If there a way android sends开发者_StackOverflow broadcast as and when App does Tx and Rx of data packets.

2) If so, how can I register for that broadcast.

Reason: The TrafficStats, Api google provides is not helpful for me, I want to display graph of Tx and Rx of every App with respect to time in X-Axis , which means I need to get accurate time at which Tx and Rx happens.

TrafficStats Api will not help me, because a) it is not accurate, the total Tx and individual UID tx doesn't match. b) There is no way I can get Tx and Rx with respect to time.

I would really appreciate if someone could give me some pointers. Thank you very much.


If there a way android sends broadcast as and when App does Tx and Rx of data packets.

No.

There is no way I can get Tx and Rx with respect to time.

Sure you can. It's called "sampling". Get the values at time X. Then get the values at time X+Y. Subtract the second readings from the first. Now you know "Tx and Rx with respect to time" for Y. Repeat as needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜