How to show daily total internet data usage by android programmatically?

1.1k Views Asked by At

I want to show the user how much internet data he consumed from 12am of that day till he checks, like the Datally app by google.

I know that we can see the total data usage after last reboot using TrafficStats class's getTotalRxBytes and getTotalTxBytes. That value resets in every reboot time. But I don't want want to reset the daily data usage even if the user reboots his device.

I searched for it all over the StackOverFlow, but failed to get an answer. I found so many ways to show data usage per app basis; I don't need them.

So, how can I able to show the daily total (Mobile + Wifi + Sent + Recieved) live data usage in my android application programmatically? If you have an answer, please tell me.

0

There are 0 best solutions below