logo
logo
Sign in

How to Create Virtual Assistant Apps like Siri and Google Assistant

avatar
Vlad Dm
How to Create Virtual Assistant Apps like Siri and Google Assistant

How to include a voice assistant in an app

There are three ways to make your app understand verbal language and keep up a conversation.
The first method
The first method involves integrating existing voice technologies into your application by means of special APIs and other development tools.
The second method
The second method allows you to build an intelligent assistant with the help of open source services and APIs.
The third method
The third method stands for the development of a voice assistant from scratch with its further integration into your application.
Each method is worthy of attention. Note that the big names like Apple or Google reluctantly offer their beloved creations to the third-party developers. On the other hand, using open source tools may not meet your expectations. Also, developing apps like Siri on your own may become an impossible task.
To clarify all the benefits and risks you are going to encounter, let's consider each approach in details.
how to integrate your app with a virtual assistant
Common ways to integrate your app with a virtual assistant

The best virtual assistants and their integration in an app

Siri, Google Now, and Cortana are the world-known names. Of course, there are many more mobile assistant apps on the shelves of app stores. You can check out a comprehensive list here. However, we are going to focus on the three technologies mentioned above because, according to the MindMeld research, they are preferred by the majority of users.

Siri

If you ever studied Siri, you certainly noticed that it was unavailable for most of the third-party applications. With iOS 10 release, the situation has changed a lot. At WWDC 2016, it was announced that Siri can be integrated with the apps that work in the following areas:
  • Audio and video calls
  • Messaging and contacts 
  • Payments via Siri 
  • Photos search 
  • Workout Car booking 
To enable the integration, Apple's introduced a special SiriSDK that consists of two frameworks. The first one covers the range of tasks to be supported in your app, and the second one advises on a custom visual representation when one of the tasks is performed.
Each of the app types above defines a certain range of tasks which are called intents. The term refers to the users' intentions and, as a result, to the particular scenarios of their behavior.
 
In SiriSDK, all the intents have corresponding custom classes with defined properties. The properties accurately describe the task they belong to. For instance, if a user wants to start a workout, the properties may include the type of exercises and the time length of a session. Having received the voice request, the system completes the intent object with the defined characteristics and sends it to the app extension. The last part processes the data and show the correct result at the output.
You can find more information about how to work with intents and objects on Apple's official website. Below is a scheme on intents processing:
how to program Siri: intenats processing
How Siri processes intents

Google Now and voice actions

Remember the good cop, bad cop technique? Well, Google has always been the first one to show the maximum loyalty to developers. Unlike Apple, Google doesn't have strict requirements for design. The approvement period in the Play Market is much shorter and not as fastidious as in the Apple App Store too.
Nevertheless, in a question of smart assistant integration, it appears quite conservative. For now, Google assistant works with the selected apps only. The list includes such hot names as eBay, Lyft, Airbnb, and others. They are allowed to make their own Now Cards via special API.
 
The good news is that you still have a chance to join the ranks of the proud owners of a Now assistant in your app. For that, you need to register the application with Google.
Remember not to confuse Google Now with the voice commands. Now is not just about listening and responding. It is an intelligent creature that can learn, analyze, and conclude. Voice actions are the narrower concept. It works on the basis of speech recognition followed by information search.
Google provides the developers with a step by step guide for integrating such functionality into an app. Voice Actions API teaches how to include a voice mechanism both in mobile and wearable apps.
Google's intelligent mechanism
What is Google's intelligent mechanism

Cortana

Microsoft encourages developers to use the Cortana voice assistant in their mobile and desktop apps. You can provide the users with an opportunity to set a voice control without directly calling Cortana. In the Cortana Dev Center, it describes how to make a request to a specific application. Basically, it offers three ways to integrate the app name into a voice command:
Prefixal
Prefixal, when the app name stands in front of the speech command, e.g., 'Fitness Time, choose a workout for me!'
Infixal
Infixal, when the app name is placed in the middle of the vocal command, e.g., 'Set a Fitness Time workout for me, please!'
Suffixal
Suffixal, when the app name is put to the end of a command phrase, e.g., 'Adjust some workout in Fitness Time!'
You can activate either the background or foreground app with speech commands through Cortana. The first type is suitable for apps with simple commands that don't require additional instructions, e.g., 'Show the current date and time!'. The second - for the apps that work with more complex commands, like 'Send the Hello message to Ann'. In the last case, besides setting the command, you specify its parameters:
  • What message? - Hello message
  • Who should it be sent to? - To Ann.

Look at full article How to Create Virtual Assistant Apps like Siri and Google Assistant

collect
0
avatar
Vlad Dm
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more