meta data for this page
  •  
Translations of 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.

  1. 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.
  2. From the drop-down dialog, select Application.
  3. 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.
  4. Tap the back arrow (top left).
  5. Tasker will now show a dialog drop-down of all existing Tasker actions.
    1. Tap New Task.
    2. In the input dialog, enter the name of the task (here it is TaskSoMe) and tap the checkmark to accept it.
  6. Now in the Task Edit screen, tap the + button (bottom right) to add an action.
    1. In the Select Action Category dialog, select Variables
    2. In the Select Variables Action dialog, select Variable Set.
      1. 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.
      2. Set the To field to %TIMES. This is a built-in variable and must be in all capitals as shown.
  7. ​Tap the back arrow (top left) to save this task.
  8. ​Tap the back arrow again to exit the profile setup.
    1. The profile now shows its name with an * (*WhatsApp)
      1. This can be changed to any user desired meaningful name. That will not be done here, but this is how to do it:
        1. Tap and hold the existing name (*WhatsApp) to highlight it.
        2. A menu at the top of the dialog opens. The first selection is . Select it.
          1. 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.

  1. ​Remain in Tasker in the Profiles tab and tap +.
  2. ​From the drop-down dialog select Event
    1. Select System
    2. Select Tick
      1. ​Set the Interval (ms) to 60000 (which is 60,000 milliseconds, or 1 minute) which will be the update frequency.
    3. Tap the back arrow
  3. Tasker will now show a drop-down dialog which lists all existing tasks.
    1. Tap New Task
    2. Name the task LastChecked and tap the checkmark.
  4. In the Task Edit dialog add two actions to this task:
    1. ​Action 1 (Calculate Time):
      1. ​Tap + to add the first action.
      2. ​From the Select Action Category dialog listing
        1. Select Variables
        2. Select Variable Set.
          1. Set Name to %LastChecked
          2. Set To to round((%TIMES-%SoMe)/60)
          3. Check the box for Do Maths.
          4. Tap the back arrow.
    2. Action 2 (Send to Total Launcher):
      1. Tap + to add the second action.
      2. From the Select Action Category dialog listing
        1. Select Plugin
        2. Select Total Launcher
        3. Select Send variable.
      3. ​Tap the Configuration item's pencil icon to configure it.
      4. In the Send Variable dialog
        1. Tasker variable enter: %LastChecked
        2. Variable name in Total Launcher enter: taskerLastChecked
        3. Tap OK
      5. Tap the back arrow to save the action.
  5. ​Now back in the main Tasker screen, tap the back arrow again to save the entire task profile.
    1. 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.

  1. ​On the Total Launcher home page l​ong-press an empty space or pinch to enter edit mode.
    1. 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”
  2. Tap the + button (top right).
  3. In the Add dialog
    1. Select Graphic
    2. In the Graphic dialog choose Text. This will create a text-based object.
  4. The Action On Tap dialog opens. Select Nothing or Default.
  5. The new object on the page is now selected​.
    1. Move it and resize it as desired. (See here for a complete description on how to accomplish this)
  6. With the text box still selected, tap the cog wheel icon (top 3rd from the left) to open its options.
  7. Select Text
    1. In the Text dialog, scroll to the bottom of list and select Variable. Tap OK.
  8. In the Edit dialog tap the list item Text field
    1. In the input dialog remove the default text
    2. 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
  9. Tap OK and exit the Edit dialog by swiping right to left
  10. Now on the home page with the new “widget” selected
    1. Insure the entire text object contents are visible. If not:
      1. Tap the Options icon (cog) in the top menu
      2. Select Font size
        1. Change size by changing the number or using the slider, then tap OK
        2. Exit the Edit dialog by swiping right to left
    2. The initial display of the object will require at least the 60000ms (1 minute) to properly display and may require some additional adjustments for:
      1. single or multi-line format (object sizing)
      2. centering within the object boundaries (alignment)
  11. 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.

Discussion

Enter your comment. Wiki syntax is allowed:
Please solve the following equation to prove you're human. 164 +7 =