Track data usage with tasker

1,375 views
Skip to first unread message

Saad Thahim

unread,
Jan 8, 2015, 6:48:48 AM1/8/15
to tas...@googlegroups.com
Is it possible to track
Mobile data/WiFi usage with tasker?

Jay M

unread,
Jan 8, 2015, 9:34:01 AM1/8/15
to tas...@googlegroups.com

Yeah Ryoen covered it ages ago check his tutorials.


On Thu, 8 Jan 2015 11:48 Saad Thahim <thah...@gmail.com> wrote:
Is it possible to track
Mobile data/WiFi usage with tasker?

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

bdanders

unread,
Jan 8, 2015, 9:54:43 AM1/8/15
to tas...@googlegroups.com
This is much easier now with the built in Java functionality. The functions built into the 'TrafficStats' class will easily return the information you need to build a data usage tracker. This only returns the usage since the last boot, so you'll have to store historical data yourself.

Richard Wallace

unread,
Jan 8, 2015, 5:55:58 PM1/8/15
to tas...@googlegroups.com
Could you elaborate on this please as I have built a data usage profile but its a bit 'sluggish' and sloppy

Saad Thahim

unread,
Jan 9, 2015, 2:28:21 AM1/9/15
to tas...@googlegroups.com
Thanks jay can you send me a link?

Jay M

unread,
Jan 9, 2015, 4:28:39 AM1/9/15
to tas...@googlegroups.com

Just Google his name you should find it easy.


On Fri, 9 Jan 2015 07:28 Saad Thahim <thah...@gmail.com> wrote:
Thanks jay can you send me a link?

bdanders

unread,
Jan 9, 2015, 12:39:38 PM1/9/15
to tas...@googlegroups.com
Create as task to measure data usage. Select the 'Java Function' task from the Code group. In the 'Class or Object' field click the magnifying glass and find the 'TrafficStats' class. Then click the magnifying glass next to 'Function' and select whatever you want to monitor. In my case I use 'getMobileRxBytes' and then put the local Tasker variable %rx_bytes in the Return field. I do the same for 'getMobileTxBytes. The sum of %rx_bytes and %tx_bytes the the total mobile date used since the phone was last booted. I also keep a global Tasker variable %DataStored that is the amount of data used in the billing period before the last boot. So whenever my task runs I calculate the total amount of data used in the billing period as %DataTotal = %DataStored + %rx_bytes + %tx_bytes. I also run a task when the device boots that copies the value of %DataTotal to %DataStored if %rx_bytes has been reset.

Richard Wallace

unread,
Jan 9, 2015, 7:04:10 PM1/9/15
to tas...@googlegroups.com
Thanks.
I've tries this and it always returns 0?

Richard Wallace

unread,
Jan 9, 2015, 7:21:32 PM1/9/15
to tas...@googlegroups.com
Scrap that it does work. I forgot I'd just rebooted.
I assume the result is in bytes?
I can use variable convert to get it in megabytes. I only ask as I turned of WiFi and browsed for a few minutes, and according to rxbytes + txbytes I used 27MB of data! Just by browsing a few basic web pages?

Richard Wallace

unread,
Jan 9, 2015, 7:24:04 PM1/9/15
to tas...@googlegroups.com
Scrap that again. It only works if WiFi is disabled.

Saad Thahim

unread,
Jan 14, 2015, 7:58:03 AM1/14/15
to tas...@googlegroups.com
I have done exactly the same thing, but it didn't worked. 
It shows a red circle on the java funtion in task list.

bdanders

unread,
Jan 14, 2015, 9:56:37 AM1/14/15
to tas...@googlegroups.com
Sorry. I'm sure it's at least somewhat dependent on your Android version. Works fine for me on two different phones running CyanogenMod 4.4.4.

Luis Gómez Guzmán

unread,
Oct 28, 2016, 4:22:59 PM10/28/16
to Tasker
Hi, can some thing like this be done for call and SMS?

Abdullah Alahdal

unread,
Oct 28, 2016, 4:27:09 PM10/28/16
to Tasker
I'm sure this can be achieved using sqlite to read data from log database

Luis Gómez Guzmán

unread,
Oct 28, 2016, 6:22:21 PM10/28/16
to tas...@googlegroups.com
How?

Luis

--
Some people put up walls, not to keep others out, but to see who cares enough to break them down.
--
If really there is evil in this world, it lies in the heart of mankind...
--
Let your enemies touch your skin, and you'll smash their flesh, let them to smash your flesh and you'll crush their bones, let them to crush your bones and you'll take their lives...
--
Special characters and accents have been omitted for system compatibility


On Fri, Oct 28, 2016 at 5:27 PM, Abdullah Alahdal <alahda...@gmail.com> wrote:
I'm sure this can be achieved using sqlite to read data from log database

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Pi5bF5zfLUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.

Abdullah Alahdal

unread,
Oct 29, 2016, 7:26:26 AM10/29/16
to Tasker
How?

Unfortunately, I updated my phone to Android 7 and it is not rooted at the moment to make this. But for sure, it can be done particularly for Calls. You can gather the duration of all calls during a period.
Reply all
Reply to author
Forward
0 new messages