AutoNotification Automatically activate USB file transfer (MTP) connection with the computer

Create profile to enable MTP USB connection of the phone when connected to PC.

  1. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    szmerek submitted a new AutoApps project:

    Automatically activate USB file transfer (MTP) connection with the computer - Create profile to enable MTP USB connection of the phone when connected to PC.

    Read more about this project...
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Thank you very much! :) Great tutorial!

    Just to make it a bit more streamlined you could've used %antouchaction right away in the task without the need to query the notifications. The intercepted notification's variables are available right away in the task :)

    Thanks again!
     
  3. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    Thank you for suggestion! Already updated tutorial.:)
     
    joaomgcd likes this.
  4. colin.p

    colin.p New Member

    Joined:
    Oct 30, 2016
    Messages:
    3
    Likes Received:
    1
    I think I hit a snag, as Tasker and Autoinput will not auto select "files transfer". When I plug my Nexus 4 (CM13) into my computer, I still have to manually select files transfer. When I press the play button in the "task" screen, I get an error after a few seconds. What do you suppose I'm doing wrong? Thanks in advance for the help.
    This is the screenshot:
     

    Attached Files:

  5. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    This tutorial is for Android 7 (I should mention it there). The notification title and popup window (when you choose the type of connection) can have different texts in Android 5 (Nexus 4) .
    What is the notification title when you connect the phone to PC?
    What is the text in popup window when you tap file transfer?
     
    Last edited: Oct 30, 2016
  6. colin.p

    colin.p New Member

    Joined:
    Oct 30, 2016
    Messages:
    3
    Likes Received:
    1
    In the drop down notification, I see "USB debugging connected, touch to disable debugging" as well as "USB for charging, touch for more options". When I tap "USB for charging" I get a popup that says "charging", "file transfers", or "Photo transfer". I can then choose file transfers, but it is pre-selected for charging.
     
  7. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    You have to enter the exact texts:
    In the AutoNotification Intercept action, you want to intercept the notification with title: USB for charging. This text enter in Notification Tilte to intercept.
    In AutoInput action you need to put in Text Field your text: File transfers. This text you want to AutoInput to "touch".

    Hope it helps!
     
    Last edited: Oct 30, 2016
    colin.p likes this.
  8. colin.p

    colin.p New Member

    Joined:
    Oct 30, 2016
    Messages:
    3
    Likes Received:
    1
    Scratch that. I changed the texts to exactly what I have in 6.01 and after a couple times of plugging/unplugging/plugging in my phone and it now works. Pretty slick and thanks for heading me into the right direction.

    edit:and that is what you typed (as I was typing). It will be good info for anyone who tries this as well. Thanks again.
     
    autormali likes this.
  9. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    Glad I could help :)
     
    colin.p likes this.
  10. Touz

    Touz New Member

    Joined:
    Apr 8, 2017
    Messages:
    2
    Likes Received:
    0
    I'm running into the exact same issue at colin.p, but the notification text seems to be the correct spelling. I'm running 7.1.1.

    Any idea what the issue might be ? Tasker doesn't seem to intercept the Android Notification and manual execution of the profile fails with an error.

    Screenshots: https://imgur.com/a/cVhH2

    Thank you for your help !
     
  11. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    I've created a test profile according to your screenshots and it's working on my device.
    Add flash action: %antitle, after AutoNotification Actions. If it returns 'USB charging this device' then AN intercept is working correct.
    Could be that the window with 'Transfer files' text is popping up after AutoInput action is executed on your phone. Try to add Wait action (0.5-1 sek) before AutoInput action .
     
  12. Touz

    Touz New Member

    Joined:
    Apr 8, 2017
    Messages:
    2
    Likes Received:
    0
    when adding the flash action it flashes the string %antitle. The intercept doesn't seem to work because when I plug in my phone the profile doesn't trigger.
     
  13. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    What are AutoNotification logs records for the intercept action?
     
  14. Sean Smith

    Sean Smith New Member

    Joined:
    Jun 4, 2017
    Messages:
    1
    Likes Received:
    0
    The tutorial is incomplete. When I try to add a profile I get asked for "first context" and I get a list of options. The most likely option is "event" or "state" but I don't know which and even if I choose one this "tutorial" gives no indication what to select afterwards.
    Samsung S5, Android 7
     
  15. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    You can see there is "event" context choosen in the first step video. The tutorial description has been updated. Thanks!
     

Share This Page