Something simple....

Discussion in 'Tasker Guides / Examples / Ideas Forum' started by jdkbph, May 3, 2016.

  1. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    Hi. I purchased this app, and several dozen others, all in a quest to perform something stupidly simple (I think) on my phone. I'm using AppRadio Unchained Reloaded to connect my OnePlus 2 phone to the AppRadio3 head unit in my car. The problem is that phone makers seem to have universally decided to drop hardware HDMI support in favor of screen casting. I need to cast my phone screen to the head unit using a Chromecast 2 device.

    I am able to do this manually by crawling through the phone settings, selecting various functions, and clicking on certain items and options with my fingers, and it works well enough. But when I try to automate the process using Tasker, I can only get so far before it stalls. And it always stalls at the same point... cast to device. I KNOW I'm doing something wrong but I can't figure out what it is.

    Most of the profiles I find on the web use a method whereby Tasker simulates manual swipes and taps by specifying coordinates on the screen. Timing issues and differences in phones and phone configurations (eg, are you showing notifications in your drop down and if so how many?) make this a hit or miss process at best. I'm looking for something else. I was hoping Autocast was that something else.

    Is there a way to tell Autocast, via Tasker, to connect to a specific device at a specific point in the process by adding a task to a Tasker profile? If so, how? Exactly?

    Any help here would be very much appreciated.

    PS, I'm simply trying to mirror the screen from my phone to the head unit... not a specific app.
     
    Last edited: May 3, 2016
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Unfortunately AutoCast can't do that. But AutoInput probably can :) Can you try this method?

    Hope this helps
     
  3. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    Hi and thanks for the tip. Unfortunately this vid only makes clear that you CAN do this... but not how. There are questions I can't seem to find answers for. For instance, if I try to set this up I'm pretty sure I need to select CLICK as the first parameter. But then what am I clicking on? Is it TEXT? Id? Focus? List? which? And what is the Field ID? Do I type the name of the device here as it appears on the screen? Of do I needs some %'s or #'s or ()'s.

    I'm not very experienced at this kind of thing... just trying to cast my phone to my head unit using a Tasker profile.

    Thanks, and I would appreciate any advice or sources of info you can point me to.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Did you check the video description? :)
     
  5. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    Aha. No I didn't follow the vid back to You Tube. I see it now though... thanks
     
  6. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    OK sorry to be a pain, but I'm still not getting it. There are no real instructions or tutorials on any of the pages you linked to. Just a bunch of videos showing what can be accomplished with these Auto* tools. It is impressive, but doesn't do me much good if I can't figure out how to do what your videos show.

    Specifically the problem I'm having is that my Tasker profile will get me all the way to the point where the screen shows the cast app and it's asking me which device to cast to. The answer is RIGHT THERE in the dialog box but I can't get AUTOINPUT, or the Tasker profile I created with it, to click on the one and only option that appears there. My Chromecast device is named CC2Honda. I've tried manually added that to the task as a VALUE, I've tried using the simple method to record the clicks... none of it works. The simple method BTW interpreted my physical click as some crazy combination of numbers and letters about 20 characters long... com.android.systemUI something something something. I have no idea what that's about.

    Anyway, if you could just tell me how to make AUTOINPUT auto input the value CC2Honda when the cast app is looking for a device to cast to, I would really appreciate it.
     
  7. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Did you check this link that's mentioned in the video description? http://forum.joaoapps.com/index.php?resources/cast-screen-automatically.46/
    That's what I meant before :)

    About your issue can you please export your task's description (not xml) so I can take a look? Long-click the task in Tasker->export description
    It should be as easy as configuring it to click on the text CC2Honda

    Thanks in advance
     
  8. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    Here's the task:


    Cast (3)
    A1: WiFi Tether [ Set:On ]
    A2: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
    A3: Launch App [ App:Chromecast Data: Exclude From Recent Apps:Off Always Start New Copy:On ]
    A4: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
    A5: AutoInput Action [ Configuration:Type: Text
    Value: Open navigation drawer
    Action : Click Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
    A6: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
    A7: AutoInput Action [ Configuration:Type: Text
    Value: Cast screen
    Action : Click Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
    A8: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
    A9: AutoInput UI Query [ Configuration:Text: Connect to device Package:com.joaomgcd.autoinput Name:AutoInput UI Query Timeout (Seconds):20 ]
    A10: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
    A11: [X] AutoInput Action [ Configuration:Type: Id
    Value: com.android.systemui:id/task_view_content
    Action : Click
    Is Tasker Action: false
    Check Screen State: false Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
    A12: AutoInput Action [ Configuration:Type: Text
    Value: CC2Honda
    Action : Click
    Is Tasker Action: false
    Check Screen State: false Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
    A13: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
    A14: Perform Task [ Name:Exit App Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]


    Thanks for looking into this.
     
  9. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you tell on which action that task stops working?
     
  10. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    It seems to be this one:

    A12: AutoInput Action [ Configuration:Type: Text
    Value: CC2Honda
    Action : Click
    Is Tasker Action: false
    Check Screen State: false Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]


    Although it sometimes, almost randomly hangs up on one of the preceding tasks related to the "cast" application. Usually at the place where you would tap on the "cast to screen" option. This script is launching Google Cast or Chromecast app rather than the built in android cast feature, yes? I'm OK with that so long as it works, but like I said... it seems to be spotty.
     
  11. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    It seems that you have a space after "CC2Honda" there. Is that maybe the issue?
     
  12. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    No it's not the space. Or I'm not intentionally or accidentally putting it there anyway. I remove it and it comes back. Seems like the app is adding the space for some reason.
     
  13. jdkbph

    jdkbph New Member

    Joined:
    Apr 25, 2016
    Messages:
    8
    Likes Received:
    0
    OK so I really stripped this thing down to just the two problem steps: open the cast app, then click the device name. Even if I run it manually (the play button) , it opens the app but will not click the device name. it just doesn't work. Either there's a trick to this - %label% this, or \$value that - that I'm not aware of, or it just doesn't work... period.

    If I'm not mistaken you are the app author? If so I think it's fair to say if you don't know the answer, there is no answer. Hoping for the best here, but...
     
  14. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you try just "CC2" instead of "CC2Honda"?

    And yes, I'm the app author :) It's possible that the field just isn't clickable by AutoInput though... More info here: http://joaoapps.com/autoinput/faq/

    But in this case it should be since it worked for me, unless it's something specific to your device.
     
  15. RhyTech

    RhyTech New Member

    Joined:
    Jun 19, 2016
    Messages:
    5
    Likes Received:
    3
    I've been playing around with AutoInput recently and after getting used to it, the "Easy Setup" tool is a GUI lover's dream.

    Clicking on my chromecast gives me a popup with the options to choose from:
    • Element ID: com.google.android.apps.chromecast.app:id/mr_chooser_route_icon
    • Element Text: [Chromecast Name]
    • Element number 1 in list 'com.google.android.apps.chromecast.app:id/mr_chooser_list'
    • Element Center Point (x,y) : ####
    I slapped this together and it seems to work for me:

    A1: Launch App: Google Cast
    A2: Wait
    A3: AutoInput Action [ Configuration:Type: Point Value: 84,159 Action : Click ] *Opens Menu*
    A4: Wait
    A5: AutoInput Action [ Configuration:Type: Text Value: Cast screen / audio Action : Click ] *Selects Menu*
    A6: Wait
    A7: AutoInput Action [ Configuration:Type: Id Value: com.google.android.apps.chromecast.app:id/mr_chooser_route_icon Action : Click ]

    Hope this helps

    EDIT:
    A few further thoughts after re-reading your original program, my phone didn't need A9, it showed the list of available chromecasts already and I'm not quite sure what A11 does clicking on a systemui or what the [X] means in the text export.
     
    Last edited: Jun 19, 2016

Share This Page