How to find wifi and network data usage separately by particular application in android?

Sagar Maiyad picture Sagar Maiyad · Nov 17, 2013 · Viewed 8.2k times · Source
recived = TrafficStats.getUidRxBytes(uid);
send = TrafficStats.getUidTxBytes(uid);

TrafficStats.getMobileRxBytes(); 
TrafficStats.getMobileTxBytes(); 

TrafficStats.getTotalRxBytes();
TrafficStats.getTotalTxBytes();

i have application id and i can get that application data usage but i cant get information in more detailed like data usage using wifi and network. i want to find both separately for all installed application in device. how can i find that.? i have already tried many things but didn't get any solution for that.

Answer

artemiygrn picture artemiygrn · Dec 6, 2013

I think you should use alternative way, get traffic by UID, for example — getUidRxPackets(int uid)

Also helpful (how get UID): (How to get all apps installed on android phone)

EDIT:

can you tell me how i can determine how much data use by wifi and mobile.??

There a nice answer — android statistic 3g traffic for each APP, how? look his logic.