Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Android 6 Essentials

You're reading from   Android 6 Essentials Design, build, and create your own applications using the full range of features available in Android 6

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher Packt
ISBN-13 9781785884412
Length 122 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Yossi Elkrief Yossi Elkrief
Author Profile Icon Yossi Elkrief
Yossi Elkrief
Arrow right icon
View More author details
Toc

Voice interactions


Voice interactions usually originate from user voice action. However, the voice interaction activity starts without any user input. Android Marshmallow has a new voice interaction API that, together with voice actions, allows us to build conversational voice experiences into our apps. Use the isVoiceInteraction() method to determine whether an activity is triggered by a voice action. Then, you can use the VoiceInteractor class and interact with the user.

Don't get confused with the isVoiceInteractionRoot() method, which returns true only if the activity is also the root of a voice interaction. Here, you will get true if your activity was started directly by the voice interaction service and not by another activity (another app) while undergoing voice interaction.

A best practice would be to prompt the users and confirm that this is their intended action. You already know that voice input is invoked from Google Now, where you can open URLs with a simple voice input, such...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image