Create Google Search Notification in Android 7 and above

Learn how you can create your own Google Search "widget" in your notification tray

  1. joaomgcd
    This is how it'll look like when it's done:

    [​IMG]

    STEP 1 - CREATE SEARCH NOTIFICATION


    • Create a new Task called Google Search Notification
    • Add an AutoNotification action
    • Set the Notification ID to googlesearch
    • Set the Title to Google Search
    • Set the Text to What do you want to search?
    • Set the Reply Action to googlesearch
    • Set the Reply Label to Search Terms
    (i) Because the reply action is googlesearch the notification will send AutoApps commands like googlesearch=:=whatever search terms you write
    • Go back to Tasker, run the task and check that the notification has a text input box.


    STEP 2 - ADD SEARCH ICON


    The notification would look better if it didn't have the stock AutoNotification Icon, so set its status bar icon to this instead.

    Run the task again. That looks better now. :cool:


    STEP 3 - CREATE PROFILE TO HANDLE SEARCH


    • Create a new profile with the AutoApps Command condition
    • Set the Command Filter to googlesearch=:=
    • Set the Variable Names field to searchterms
    (i) Because we set the Variable Names field, whenever a command like googlesearch=:=birds is sent, a variable named %searchterms will be created with whatever is on the right of =:= which in this case would be birds
    • Create an entry task for the profile


    STEP 4 - DO SEARCH AND RE-CREATE NOTIFICATION


    • Add an AutoShare action
    • Import the Google Now Text Search intent if you don't have it already
    • Use it in the action
    • Set the Search Terms field to %searchterms
    • Go back to Tasker
    • Add a Perform Task action that calls the Google Search Notification task
    (i) You'll need to re-create the originally created notification or else you won't be able to write anything else in it and the reply input box will keep it spinning progress indicator forever.
    • Exit Tasker to save


    STEP 5 - TEST


    If you now write something in the notification input a google search will appear and the notification will be re-created.

    But hold on, it would be better if the notification tray would collapse automatically so we could see the search results, wouldn't it?


    STEP 6 - HIDE NOTIFICATIONS AUTOMATICALLY


    Go back to the entry task in the created profile and add a Close System Dialogs action.

    Exit Tasker and do a search again. Aaah, much better ;)