I'm trying to read out the traffic generated by the running applications. I pretty much want to get network usage data of every process.
TrafficStats.getUidRxBytes(ProcessUID); would sometimes return the right result, but sometimes a "-1" would be returned. If I understand correctly, TrafficStats.UNSUPPORTED is returned in the above cases, what I don´t understand is, why? I thought the UNSUPPORTED flag was meant to differ the ability of running device to fetch the data and was not bind in any way to a certain process.
Integer ProcessUID = ProcessListData.get(i).getUID();
Long RxBytes = TrafficStats.getUidRxBytes(ProcessUID);
Long TxBytes = TrafficStats.getUidTxBytes(ProcessUID);
I am running Android 2.3.3. Thanks!