meta data for this page
- en
How To: Monitor Time Since App Last Opened - Tasker Integration
- Step 1: Log into Tasker
Create a profile that saves the current time into a variable (%SoMe) every time the user opens the target application.
- Once in Tasker, tap the Profiles tab to open the Profile dialog and then tap the + button (bottom right) to create a new profile. It will be automatically names, but the name can be edited later.
- From the drop-down dialog, select Application.
- Scroll through the application listing to find and select the app or apps to monitor (in this example a select of WhatsApp is made) which will highlight the app. This listing only includes apps which are on the user device.
- Tap the back arrow (top left).
- Tasker will now show a dialog drop-down of all existing Tasker actions.
- Tap New Task.
- In the input dialog, enter the name of the task (here it is
TaskSoMe) and tap the checkmark to accept it.
- Now in the Task Edit screen, tap the + button (bottom right) to add an action.
- In the Select Action Category dialog, select Variables
- In the Select Variables Action dialog, select Variable Set.
- Set the Name to
%SoMe. There can only be alpha-numeric characters or underscores, no spaces or other special characters. There must be at least one capital letter to make the variable global and be retained by Tasker. - Set the To field to
%TIMES. This is a built-in variable and must be in all capitals as shown.
- Tap the back arrow (top left) to save this task.
- Tap the back arrow again to exit the profile setup.
- The profile now shows its name with an * (*WhatsApp)
- This can be changed to any user desired meaningful name. That will not be done here, but this is how to do it:
- Tap and hold the existing name (*WhatsApp) to highlight it.
-
- In the input dialog, enter the desired name and tap the checkmark.
A profile has been created that updates the %SoMe variable with the current time (in seconds) every time WhatsApp is opened.
- Step 2: In Tasker, Calculate Time & Send to Total Launcher
Create a second profile that runs every minute to: * Calculate the time since the app was last opened. * Send that calculation to Total Launcher.
- Remain in Tasker in the Profiles tab and tap +.
- From the drop-down dialog select Event
- Select System
- Select Tick
- Set the Interval (ms) to
60000(which is 60,000 milliseconds, or 1 minute) which will be the update frequency.
- Tap the back arrow
- Tasker will now show a drop-down dialog which lists all existing tasks.
- Tap New Task
- Name the task
LastCheckedand tap the checkmark.
- In the Task Edit dialog add two actions to this task:
- Action 1 (Calculate Time):
- Tap + to add the first action.
- From the Select Action Category dialog listing
- Select Variables
- Select Variable Set.
- Set Name to
%LastChecked - Set To to
round((%TIMES-%SoMe)/60) - Check the box for Do Maths.
- Tap the back arrow.
- Action 2 (Send to Total Launcher):
- Tap + to add the second action.
- From the Select Action Category dialog listing
- Select Plugin
- Select Total Launcher
- Select Send variable.
- Tap the Configuration item's pencil icon to configure it.
- In the Send Variable dialog
- Tasker variable enter: %LastChecked
- Variable name in Total Launcher enter: taskerLastChecked
- Tap OK
- Tap the back arrow to save the action.
- Now back in the main Tasker screen, tap the back arrow again to save the entire task profile.
- Again, if desired the profile named *Tick 60000 can be renamed it desired (see above step …)
Tasker is now fully set up. The object will not display the timer results (only the static text) until the targeted app is first opened. Once that occurs then every 60 seconds it calculates the minutes since the app last opened and sends that number to a Total Launcher variable named taskerLastChecked.
- Step 3: In Total Launcher, Display the Data
Tasker is now sending the data, but Total Launcher needs an object to receive it. Create the “widget” in Total Launcher to “catch” and display it.
- On the Total Launcher home page long-press an empty space or pinch to enter edit mode.
- A page/screen other than Home can be selected by scrolling left or right to the desired page and then performing the above step. However, this intent of this project is to observe how much time has lapsed since last opening an app and the home page is the most logical location since the typical user as called it “home”
- Tap the + button (top right).
- In the Add dialog
- Select Graphic
- In the Graphic dialog choose Text. This will create a text-based object.
- The Action On Tap dialog opens. Select Nothing or Default.
- The new object on the page is now selected.
- Move it and resize it as desired. (See here for a complete description on how to accomplish this)
- Select Text
- In the Text dialog, scroll to the bottom of list and select Variable. Tap OK.
- In the Edit dialog tap the list item Text field
- In the input dialog remove the default text
- then type in the text to be displayed on the screen widget. Use the exact variable name which was set in Tasker (Step 2.4.b.IV.B)
- An example would be:
Last checked: <taskerLastChecked> mins ago
- Tap OK and exit the Edit dialog by swiping right to left
- Now on the home page with the new “widget” selected
- Insure the entire text object contents are visible. If not:
- Tap the Options icon (cog) in the top menu
- Select Font size
- Change size by changing the number or using the slider, then tap OK
- Exit the Edit dialog by swiping right to left
- The initial display of the object will require at least the 60000ms (1 minute) to properly display and may require some additional adjustments for:
- single or multi-line format (object sizing)
- centering within the object boundaries (alignment)
- To exit Edit mode, tap Edit ON in the lower left screen corner.
Finished! The Total Launcher screen widget will now automatically update every minute with the value received from Tasker.
Comments & Feedback
Toby Lancer is ready to help! Look for the Quick Help form:
► Desktop: left sidebar located near the bottom for Private to Admin
► Mobile: 3-bar menu at page top.
► Use the Discussion section below to share any experiences and communications with other Total Launcher users.
► Any Registered User can directly update this and any wiki page if desired.
Moderation: To keep the manual clean, all comments are held for appropriateness review. Preview any comment before submitting it. It will not display after submission until reviewed. So, please, do not resubmit.
Formatting: If using any code snippets place them inside code tags (e.g., 'code') using double single quotes (') before and after to keep them readable.
Be Kind: This is a community effort. Please keep feedback constructive and on topic.
~~DISCUSSION~~