I want to read / proc / net / xt _qtaguid / stats in Android ICS, which records all the traffic parameters of interfaces and applications. following code snippet:
String line = null;
BufferReader reader = new BufferedReader(new FileReader(new File("/proc/net/xt_qtaguid/stats")));
line = reader.readLine();
splitLine(line, keys);
line = reader.readLine();
If I cat this file, it will show:
IDX IFACE acct_tag_hex uid_tag_int cnt_set rx_bytes rx_packets tx_bytes tx_packets rx_tcp_bytes rx_tcp_packets rx_udp_bytes rx_udp_packets rx_other_bytes rx_other_packets tx_txtp_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_tx_tc_tc
2 rmnet0 0x0 0 0 6266 105 8882 121 1428 30 4838 75 0 0 208 4 2552 44 6122 73
3 rmnet0 0x0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 rmnet0 0x0 1000 0 0 0 2262 39 0 0 0 0 0 0 0 0 2262 39 0 0
5 rmnet0 0x0 1000 1 0 0 290 5 0 0 0 0 0 0 0 0 0 290 5 0 0
6 rmnet0 0x0 10004 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7 rmnet0 0x0 10004 1 20177 36 7037 81 20177 36 0 0 0 0 7037 81 0 0 0 0
, NetworkStatsFactory.java( Android) .
, :
try{
NetworkStats stats = new NetworkStatsFactory().readNetworkStatsDetail(10004);
stats.size();
}
catch(IllegalStateException e){
}
Google ?:)