Page 1 of 1

Mobile data usage

Posted: 21 Oct 2018 13:35
by Luca.Biraghi
Hello Martin!
I write to ask a question.
I've already built a flow to monitor and show in notification my mobile data usage but, having shifted to an operator that resets his plan every month on the same day, I'd like to build a simpler flow.
For the one I use now, I use Init network traffic variable. My question is: considering that android 6 already keeps track of the mobile data used on a month cycle and show the number that I want (see the attached picture), is there a way to initialize "that" number? It's already calculated and it would not be necessary to do all the maths to update the network value and all the other stuff to get the used data.
Thanks for helping,

Luca

Re: Mobile data usage

Posted: 21 Oct 2018 18:18
by Martin
Hi,

Action Init Variable Network Statistics queries the data recorded by the system and should work on Android 6+.

Regards,
Martin

Re: Mobile data usage

Posted: 21 Oct 2018 18:20
by Desmanto
AFAIK, there is no way to clear/reset that data usage statistic using standard API. You have to use root and delete the /data/system/netstats to reset it. Be careful, deleting wrong files can cause havoc to your phone. So make sure you know the risk you are facing.

Better just make you own calculation at the beginning of the new period. You can store the starting point of the statitic to a glovar or text file.