How to make capusle that launches a specific app?

153 Views Asked by At

So, I was thinking of making a capsule for launching a specific app in the phone. Now apps can be called by their commonly spoken names. For eg. Instagram can be called "insta", Facebook can be called "fb". So the launcher capsule should properly map the correct app with its commonly spoken name. Now the catch here is that there can be many apps starting from same prefix. For eg Instagram, Instamart, Instagram Lite all start with "insta", so our capsule much define certain conditions such that it opens a specific app, maybe based on previous user search history. Or else it should display a list of apps to the user.

2

There are 2 best solutions below

0
On

app-launch can launch an app installed on device with Android deep-link URI. Please see more in https://bixbydevelopers.com/dev/docs/reference/type/result-view.app-launch

However, I'd like to share a few thoughts:

  1. A capsule is voice assistant focused. I might be wrong, but to me Facebook, Instagram are rather common in their full names when people are speaking. The shorted version are usually in texting.
  2. A capsule is also focused on assisting user with a specific task. By design (for security and privacy) that a capsule is isolated from the device. Currently a capsule cannot detect or check the list of apps installed on device. In the question's example, if utterance is "launch insta", capsule must decide either Instagram, Instamart, InstaXYZ before fill-in the URI. Capsule is unable to search and launch an app start with "Insta" or prompt a list of apps installed on device start with "Insta".
  3. For common apps, such as Google maps, Facebook, Netflix, the utterance "launch [app name]" is already supported. For example, utterance "Launch facebook" already works. Assume this capsule is called "My launcher", the new utterance would be "Ask my launcher to launch fb", which would be difficult for user to adopt.
  4. In practice, app-launch is used with a specific app at mind. For example, a workout app developer created a capsule so that users can add an entry to workout app and launch the app in one utterance.

Hmm, a final note, seems Bixby already learned fb. The utterance "launch fb" works... LOL

0
On

I have done a similar project. For now I have launched an app via the URI, check it out.

Part of it is for debugging purposes.

result-view {
   match {
     RetrievedItem (this) {
       from-output: SearchSong (output)
     }
   }
  
  message("") // override empty string to avoid displaying default result dialog. If you want to debug, you can print `#{value(this.uri)}` here instead
  app-launch {
    payload-uri ("#{value(this)}")
  }
  render{
    layout{
      section{
        content{
          paragraph{
            value("URI: #{value(this)}")
          }
        }
      }
    }
  }
}