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

前端 未结 2 903
我在风中等你
我在风中等你 2021-02-05 18:49
recived = TrafficStats.getUidRxBytes(uid);
send = TrafficStats.getUidTxBytes(uid);

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

TrafficStats.get         


        
2条回答
  •  庸人自扰
    2021-02-05 19:33

    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.

提交回复
热议问题