I've started recently learning android, and in my current project i need to count daily, weekly, monthly 3G and WiFi internet traffic. By now i could find that:
long totalRecievedBytes = TrafficStats.getTotalRxBytes();
long totalTransmittedBytes = TrafficStats.getTotalTxBytes();
String allTraffic = humanReadableByteCount(totalRecievedBytes + totalTransmittedBytes);
TextView tv = (TextView) findViewById(R.id.traffic_3g_all);
tv.setText(allTraffic);
i've seen netcounter app and it writes all traffics data to phone's memory. when launched reads traffic data from memory.
what kind of ways exist to collect information about 3G, WiFi internet traffic usage for daily, weekly, monthly?
thanks, any answers appreciated.