App usage time tracker
Moderator: Martin
App usage time tracker
Since I wanted to know how much time I spent on any app one my phone I created these two flows and on widget. "App task started" flow logs the time the app was launched. "App task ended" flow logs the time the respective app was dismissed. It also calculates the duration the app was used. The app usage widget is used to display the top ten used apps. It has clickable actions . Top most portion of the widget when clicked resets the app usage data. Bottom portion when clicked display the current app usage times. Please note that the duration of app usage is not calculated if the app is running in the background. Here are the flows and widget :
http://automagic4android.com/flow.php?i ... a8132da742
http://automagic4android.com/flow.php?i ... a8132da742
Re: App usage time tracker
Updated flows which includes top 15 apps that is used the most. Widget image attached here.
http://automagic4android.com/flow.php?i ... f00d59ff6f
Aside : Since I have a list of excluded apps , my script logic loops through the top 15 apps and also removes the excluded apps which results in the widget showing less than 15 apps. In scripting, wish there was removeMapEntries function to remove all the other apps other than the top 15 so that I didnt have to loop through apps. removeMapEntry doesn't seem to work.
http://automagic4android.com/flow.php?i ... f00d59ff6f
Aside : Since I have a list of excluded apps , my script logic loops through the top 15 apps and also removes the excluded apps which results in the widget showing less than 15 apps. In scripting, wish there was removeMapEntries function to remove all the other apps other than the top 15 so that I didnt have to loop through apps. removeMapEntry doesn't seem to work.
- Attachments
-
- Screenshot_2016-05-26-12-25-07.png (808.43 KiB) Viewed 38162 times
Re: App usage time tracker
Have you considered using Gleeo or another time/event tracker to do the actual calculation - and possibly visualisation -, and let the flow simply start/stop activity recording?
Re: App usage time tracker
@Bushmills thank you for your suggestion. I tried gleeo with automagic but sadly it doesn't record app usage intervals in seconds.
Re: App usage time tracker
What exactly do i have to do after activating the flows and placing the widget?
...did it and it keeps showing me whats on the screenshot - i feel dumb =)
...did it and it keeps showing me whats on the screenshot - i feel dumb =)
Re: App usage time tracker
@Claas the widget has two clickable actions, top and bottom click. if you click the top portion of the widget, it resets the app usage data. If you click the bottom portion of the widget, it refreshes and shows the latest app usage data. For the widget to show any new data, you have to click the bottom portion anytime you need the latest app usage data. I hope this helps....
Note : After clicking the top portion, click the bottom portion only after using some apps as this widget needs some app usage data to be displayed. Otherwise you may get error message.
Note : After clicking the top portion, click the bottom portion only after using some apps as this widget needs some app usage data to be displayed. Otherwise you may get error message.
Re: App usage time tracker
When I click on top nothing happens and bottom always brings up an error message
Log files are too much for me =)
28.05.2016 23:16:10.005 [Clickable WidgetApp usage] Start executing action 'Script: Show app usage'
28.05.2016 23:16:10.032 [Clickable WidgetApp usage] Action 'Script: Show app usage'
ch.gridvision.ppam.androidautomagic.simplelang.a.d: Error while calling function getElement (Expression: getElement(apps, i)[line 11], Cause: Invalid index 0, size is 0)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:736)
at ch.gridvision.ppam.androidautomagic.simplelang.c.ah.b(SourceFile:49)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:396)
at ch.gridvision.ppam.androidautomagic.simplelang.c.d.b(SourceFile:22)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:803)
at ch.gridvision.ppam.androidautomagic.simplelang.c.y.b(SourceFile:42)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:144)
at ch.gridvision.ppam.androidautomagic.simplelang.c.ac.b(SourceFile:23)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:886)
at ch.gridvision.ppam.androidautomagic.simplelang.c.ab.b(SourceFile:78)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:803)
at ch.gridvision.ppam.androidautomagic.simplelang.c.y.b(SourceFile:42)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:116)
at ch.gridvision.ppam.androidautomagic.simplelang.c.am.b(SourceFile:33)
at ch.gridvision.ppam.androidautomagic.simplelang.a.k.a(SourceFile:836)
at ch.gridvision.ppam.androidautomagic.simplelang.a.k.a(SourceFile:817)
at ch.gridvision.ppam.androidautomagic.c.a.et$1.d(SourceFile:119)
at ch.gridvision.ppam.androidautomagic.c.a.et$1.a(SourceFile:110)
at ch.gridvision.ppam.androidautomagiclib.util.dj$1.run(SourceFile:39)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at ch.gridvision.ppam.androidautomagic.simplelang.a.c.a(SourceFile:1983)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:728)
... 33 more
Log files are too much for me =)
28.05.2016 23:16:10.005 [Clickable WidgetApp usage] Start executing action 'Script: Show app usage'
28.05.2016 23:16:10.032 [Clickable WidgetApp usage] Action 'Script: Show app usage'
ch.gridvision.ppam.androidautomagic.simplelang.a.d: Error while calling function getElement (Expression: getElement(apps, i)[line 11], Cause: Invalid index 0, size is 0)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:736)
at ch.gridvision.ppam.androidautomagic.simplelang.c.ah.b(SourceFile:49)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:396)
at ch.gridvision.ppam.androidautomagic.simplelang.c.d.b(SourceFile:22)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:803)
at ch.gridvision.ppam.androidautomagic.simplelang.c.y.b(SourceFile:42)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:144)
at ch.gridvision.ppam.androidautomagic.simplelang.c.ac.b(SourceFile:23)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:886)
at ch.gridvision.ppam.androidautomagic.simplelang.c.ab.b(SourceFile:78)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:109)
at ch.gridvision.ppam.androidautomagic.simplelang.c.w.b(SourceFile:25)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:803)
at ch.gridvision.ppam.androidautomagic.simplelang.c.y.b(SourceFile:42)
at ch.gridvision.ppam.androidautomagic.simplelang.c.b.a(SourceFile:40)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:116)
at ch.gridvision.ppam.androidautomagic.simplelang.c.am.b(SourceFile:33)
at ch.gridvision.ppam.androidautomagic.simplelang.a.k.a(SourceFile:836)
at ch.gridvision.ppam.androidautomagic.simplelang.a.k.a(SourceFile:817)
at ch.gridvision.ppam.androidautomagic.c.a.et$1.d(SourceFile:119)
at ch.gridvision.ppam.androidautomagic.c.a.et$1.a(SourceFile:110)
at ch.gridvision.ppam.androidautomagiclib.util.dj$1.run(SourceFile:39)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at ch.gridvision.ppam.androidautomagic.simplelang.a.c.a(SourceFile:1983)
at ch.gridvision.ppam.androidautomagic.simplelang.a.b.a(SourceFile:728)
... 33 more
Re: App usage time tracker
Note : After clicking the top portion, click the bottom portion only after using some apps as this widget needs some app usage data to be displayed. Otherwise you may get error message.
Re: App usage time tracker
@vamzicool: You should propably replace the "Show app usage" script action with an actual flow, which contains the said script. That way you could properly handle the error message with exception line. I would show something like "not enough statistics gathered" in the widget when the exception occurs.
Re: App usage time tracker
@MURTUMA thank you for your suggestion. That's a good way to handle that error.