Is there any alternative to NetworkStatsManager?

270 views Asked by At

I'm looking for an alternative way to get the number of bytes received & transmitted by a specific UID on android M+.

As you know, [NetworkStatsManager] provides network traffic stats. These statistics include bytes transmitted and received and network packets transmitted and received, over all interfaces, over the mobile interface, and on a per-UID basis.

But according to documentation: [queryDetailForUid] cannot be used to measure data usage on a fine grained time scale.

Before android M, we could read system files like: /proc/uid_stat/[pid]/* files.

But it seems this trick doesn't work on android M+.

So, Is there any alternative for NetworkStatsManager?

0

There are 0 answers