0

I would like to start Endomondo tracking when my phone detects that I am running or cycling. AutoLocation allows me to use the statuses running, walking or cycling to start an app. AutoInput then allows me to start tracking.

My code so far (Endo Run Start - Starts Endomondo with Running selected):

<TaskerData sr="" dvi="1" tv="4.6u3m">
<Task sr="task17">
    <cdate>1430256070896</cdate>
    <edate>1430477481247</edate>
    <id>17</id>
    <nme>Endo Cycle Start</nme>
    <pri>10</pri>
    <Action sr="act0" ve="7">
        <code>11820</code>
        <Bundle sr="arg0">
            <Vals sr="val">
                <com.intangibleobject.securesettings.plugin.extra.BLURB>Screen &amp; Keyboard Lights On 10 Seconds</com.intangibleobject.securesettings.plugin.extra.BLURB>
                <com.intangibleobject.securesettings.plugin.extra.BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.BLURB-type>
                <com.intangibleobject.securesettings.plugin.extra.SETTING>wake_device</com.intangibleobject.securesettings.plugin.extra.SETTING>
                <com.intangibleobject.securesettings.plugin.extra.SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.SETTING-type>
                <com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_DURATION>10000</com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_DURATION>
                <com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_DURATION-type>java.lang.Long</com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_DURATION-type>
                <com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_TYPE>full</com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_TYPE>
                <com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_TYPE-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.WAKE_LOCK_TYPE-type>
                <com.twofortyfouram.locale.intent.extra.BLURB>Screen &amp; Keyboard Lights On 10 Seconds</com.twofortyfouram.locale.intent.extra.BLURB>
                <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
                <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
                <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
            </Vals>
        </Bundle>
        <Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str>
        <Str sr="arg2" ve="3">Secure Settings</Str>
        <Int sr="arg3" val="0"/>
    </Action>
    <Action sr="act1" ve="7">
        <code>11820</code>
        <Bundle sr="arg0">
            <Vals sr="val">
                <com.intangibleobject.securesettings.plugin.extra.BLURB>Keyguard Disabled</com.intangibleobject.securesettings.plugin.extra.BLURB>
                <com.intangibleobject.securesettings.plugin.extra.BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.BLURB-type>
                <com.intangibleobject.securesettings.plugin.extra.ENABLED>false</com.intangibleobject.securesettings.plugin.extra.ENABLED>
                <com.intangibleobject.securesettings.plugin.extra.ENABLED-type>java.lang.Boolean</com.intangibleobject.securesettings.plugin.extra.ENABLED-type>
                <com.intangibleobject.securesettings.plugin.extra.SETTING>keyguard</com.intangibleobject.securesettings.plugin.extra.SETTING>
                <com.intangibleobject.securesettings.plugin.extra.SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.SETTING-type>
                <com.twofortyfouram.locale.intent.extra.BLURB>Keyguard Disabled</com.twofortyfouram.locale.intent.extra.BLURB>
                <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
                <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
                <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
            </Vals>
        </Bundle>
        <Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str>
        <Str sr="arg2" ve="3">Secure Settings</Str>
        <Int sr="arg3" val="0"/>
    </Action>
    <Action sr="act2" ve="7">
        <code>20</code>
        <App sr="arg0">
            <appClass>com.endomondo.android.EndoSplash</appClass>
            <appPkg>com.endomondo.android</appPkg>
            <label>Endomondo</label>
        </App>
        <Str sr="arg1" ve="3"/>
        <Int sr="arg2" val="0"/>
    </Action>
    <Action sr="act3" ve="7">
        <code>12931</code>
        <Bundle sr="arg0">
            <Vals sr="val">
                <ActionId>&lt;null&gt;</ActionId>
                <ActionId-type>java.lang.String</ActionId-type>
                <ActionTimeout>&lt;null&gt;</ActionTimeout>
                <ActionTimeout-type>java.lang.String</ActionTimeout-type>
                <ActionType>&lt;null&gt;</ActionType>
                <ActionType-type>java.lang.String</ActionType-type>
                <FieldSelectionType>&lt;null&gt;</FieldSelectionType>
                <FieldSelectionType-type>java.lang.String</FieldSelectionType-type>
                <IsTaskerAction>false</IsTaskerAction>
                <IsTaskerAction-type>java.lang.Boolean</IsTaskerAction-type>
                <NearbyText>&lt;null&gt;</NearbyText>
                <NearbyText-type>java.lang.String</NearbyText-type>
                <StoredAction>41b9b410-a980-47f1-b060-035ba027c0e4</StoredAction>
                <StoredAction-type>java.lang.String</StoredAction-type>
                <com.twofortyfouram.locale.intent.extra.BLURB>Stored Action: Endomondo - Select Sport</com.twofortyfouram.locale.intent.extra.BLURB>
                <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
                <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>plugininstanceid plugintypeid StoredAction ActionId FieldSelectionType ActionType ActionTimeout NearbyText </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
                <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
                <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
                <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
                <plugininstanceid>f8c6a1fa-1514-4422-bee3-058ab6aec204</plugininstanceid>
                <plugininstanceid-type>java.lang.String</plugininstanceid-type>
                <plugintypeid>com.joaomgcd.autoinput.intent.IntentPerformAction</plugintypeid>
                <plugintypeid-type>java.lang.String</plugintypeid-type>
            </Vals>
        </Bundle>
        <Str sr="arg1" ve="3">com.joaomgcd.autoinput</Str>
        <Str sr="arg2" ve="3">AutoInput Action</Str>
        <Int sr="arg3" val="20"/>
    </Action>
    <Action sr="act4" ve="7">
        <code>12931</code>
        <se>false</se>
        <Bundle sr="arg0">
            <Vals sr="val">
                <ActionId>&lt;null&gt;</ActionId>
                <ActionId-type>java.lang.String</ActionId-type>
                <ActionTimeout>&lt;null&gt;</ActionTimeout>
                <ActionTimeout-type>java.lang.String</ActionTimeout-type>
                <ActionType>&lt;null&gt;</ActionType>
                <ActionType-type>java.lang.String</ActionType-type>
                <FieldSelectionType>&lt;null&gt;</FieldSelectionType>
                <FieldSelectionType-type>java.lang.String</FieldSelectionType-type>
                <IsTaskerAction>false</IsTaskerAction>
                <IsTaskerAction-type>java.lang.Boolean</IsTaskerAction-type>
                <NearbyText>&lt;null&gt;</NearbyText>
                <NearbyText-type>java.lang.String</NearbyText-type>
                <StoredAction>294c1976-e997-4f6b-937f-5132675a6b3e</StoredAction>
                <StoredAction-type>java.lang.String</StoredAction-type>
                <com.twofortyfouram.locale.intent.extra.BLURB>Stored Action: Endomondo - Cycling</com.twofortyfouram.locale.intent.extra.BLURB>
                <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
                <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>plugininstanceid plugintypeid StoredAction ActionId FieldSelectionType ActionType ActionTimeout NearbyText </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
                <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
                <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
                <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
                <plugininstanceid>47fa2b88-cad5-4ec8-9253-38ef7f344c5c</plugininstanceid>
                <plugininstanceid-type>java.lang.String</plugininstanceid-type>
                <plugintypeid>com.joaomgcd.autoinput.intent.IntentPerformAction</plugintypeid>
                <plugintypeid-type>java.lang.String</plugintypeid-type>
            </Vals>
        </Bundle>
        <Str sr="arg1" ve="3">com.joaomgcd.autoinput</Str>
        <Str sr="arg2" ve="3">AutoInput Action</Str>
        <Int sr="arg3" val="20"/>
    </Action>
    <Action sr="act5" ve="7">
        <code>12931</code>
        <Bundle sr="arg0">
            <Vals sr="val">
                <ActionId>&lt;null&gt;</ActionId>
                <ActionId-type>java.lang.String</ActionId-type>
                <ActionTimeout>&lt;null&gt;</ActionTimeout>
                <ActionTimeout-type>java.lang.String</ActionTimeout-type>
                <ActionType>&lt;null&gt;</ActionType>
                <ActionType-type>java.lang.String</ActionType-type>
                <FieldSelectionType>&lt;null&gt;</FieldSelectionType>
                <FieldSelectionType-type>java.lang.String</FieldSelectionType-type>
                <IsTaskerAction>false</IsTaskerAction>
                <IsTaskerAction-type>java.lang.Boolean</IsTaskerAction-type>
                <NearbyText>&lt;null&gt;</NearbyText>
                <NearbyText-type>java.lang.String</NearbyText-type>
                <StoredAction>de2a573e-f385-4209-9d7d-46f56c096aad</StoredAction>
                <StoredAction-type>java.lang.String</StoredAction-type>
                <com.twofortyfouram.locale.intent.extra.BLURB>Stored Action: Endomondo - Start/Pause</com.twofortyfouram.locale.intent.extra.BLURB>
                <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
                <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>plugininstanceid plugintypeid StoredAction ActionId FieldSelectionType ActionType ActionTimeout NearbyText </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
                <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
                <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
                <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
                <plugininstanceid>cd4ae41f-ed81-4b3a-8fd9-d09eee1aafc7</plugininstanceid>
                <plugininstanceid-type>java.lang.String</plugininstanceid-type>
                <plugintypeid>com.joaomgcd.autoinput.intent.IntentPerformAction</plugintypeid>
                <plugintypeid-type>java.lang.String</plugintypeid-type>
            </Vals>
        </Bundle>
        <Str sr="arg1" ve="3">com.joaomgcd.autoinput</Str>
        <Str sr="arg2" ve="3">AutoInput Action</Str>
        <Int sr="arg3" val="20"/>
    </Action>
    <Action sr="act6" ve="7">
        <code>11820</code>
        <Bundle sr="arg0">
            <Vals sr="val">
                <com.intangibleobject.securesettings.plugin.extra.BLURB>Keyguard Enabled</com.intangibleobject.securesettings.plugin.extra.BLURB>
                <com.intangibleobject.securesettings.plugin.extra.BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.BLURB-type>
                <com.intangibleobject.securesettings.plugin.extra.ENABLED>true</com.intangibleobject.securesettings.plugin.extra.ENABLED>
                <com.intangibleobject.securesettings.plugin.extra.ENABLED-type>java.lang.Boolean</com.intangibleobject.securesettings.plugin.extra.ENABLED-type>
                <com.intangibleobject.securesettings.plugin.extra.SETTING>keyguard</com.intangibleobject.securesettings.plugin.extra.SETTING>
                <com.intangibleobject.securesettings.plugin.extra.SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.SETTING-type>
                <com.twofortyfouram.locale.intent.extra.BLURB>Keyguard Enabled</com.twofortyfouram.locale.intent.extra.BLURB>
                <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
                <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
                <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
            </Vals>
        </Bundle>
        <Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str>
        <Str sr="arg2" ve="3">Secure Settings</Str>
        <Int sr="arg3" val="0"/>
    </Action>
</Task>

This code works. Only problem I have that it won't work when the phone is locked. Any ideas on that?

Moritz Schmitz v. Hülst
  • 3,229
  • 4
  • 36
  • 63

1 Answers1

1

With Tasker, the easiest way I can think of, would be using:

  • tasker plugin AutoLocation to determine your movement (on foot / running / cycling/ driving)
  • Tasker's built-in Start App action
  • another tasker plugin: AutoInput - for interacting with Endomondo (that is, if you need to automatically click some buttons)
Tomaski
  • 487
  • 3
  • 15
  • This was very helpful! Now that I know the names of the buttons in the Endomondo package I may be able to port all this to on{x}. Anyway, one thing remains: how can I use AutoInput when my screen is locked and off? – Moritz Schmitz v. Hülst Apr 29 '15 at 07:40
  • 1
    to unlock the screen use [Secure Settings](https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin) – Tomaski Apr 29 '15 at 12:25
  • although if you're on Lollipop, you might experience issues (phone not being unlocked). One way to avoid it is: [here](http://forum.joaoapps.com/index.php?resources/screen-on-and-unlock-lollipop.7) – Tomaski Apr 29 '15 at 12:31
  • Yeah, already found secure settings. Couldn't get it to work until I found the `keyguard` feature. I have to test later but right now my task disables the `keyguard` runs all the other stuff and then enables `keyguard` again. So far as I could tell it doesn't even activate the screen and I assume does not activate touch either. If it works -> perfect! – Moritz Schmitz v. Hülst Apr 29 '15 at 12:45
  • there is separate action to do just that -> Screen & Keyboard Lights On use this one first and set it to, say, 3 seconds. Then in tasker, add 1s wait and then use Secure Settings Keyguard (or Pin) functions – Tomaski Apr 29 '15 at 13:39
  • Well, I like the idea that the screen is not switched on. – Moritz Schmitz v. Hülst Apr 30 '15 at 10:32
  • but do keep in mind, that some of the automation functionalities may not work as expected. So if your task stops working or will be working every other time - try to activate the screen & lights. There may be no need to unlock the phone completely, but sometimes just waking it up helps :) – Tomaski Apr 30 '15 at 13:19
  • Seems, that it doesn't work when the screen is off. I added `wake device`. The task works when I try it in Tasker. As soon as it starts automatically though there is a problem. It starts Endomondo, then the screen goes black and I cannot interact with my phone anymore. I can still see notifications but nothing happens on any click. – Moritz Schmitz v. Hülst May 01 '15 at 10:57