1
Completed

App Info - usage time of an app

Hi, how can i check the runtime(foreground would be best) of an app in a certain periode of time. I thought about something like org.mozilla.firefox(time,1440:0) and hoped to get get back app_usage(0) in seconds.

1 reply

For now you have to get all of the app's usage times and then search for the one you want for the result.

2

1 Do you mean to get it with most(x:y,z) and what z should be used in this case ?

2 Another way would be to just ad %app_usage to the Ouput Variables for a package, with or without usage of the "get all details" checkbox...

3:
a) Please give some Info regarding battery impact of Context AppChanged and Action AppInfo. How do they work and are they event driven ...

b) Right now I check with most(time..) from a task (that runs for other purposes every 2min when screen is on) and if one of my "bad" apps are under those most() used (with app_used time > e.g. 60min).
If so I dynamically activate (as long as one of those apps is above limit) an App Changed Pofile which will start a task to kill those apps as soon as the user tries to open them.

Would it be more battery efficient to leave the AppChanged Profile active all the time and just pull AppInfo in the task from AppChanged instead of polling it everey 2min when screen is on ?

Sorry for the lack of details.

I meant that you need to get app usage for all apps and then in a For loop go through each one and see how much time each one has until you find the one you want.

I can't add app usage that way because it would make the action much slower.

For the App Changed event to trigger Tasker needs to check every X seconds for an app change. You can configure that in the Tasker Preferences.

Your way of doing it sounds more battery efficient cause you're only doing it once every 2 minutes :)

2

 Thx Joao, is context app changed event or context app X in use better
for battery life

Both of those use the same amount of battery.