Book Image

Android 6 Essentials

By : Yossi Elkrief
Book Image

Android 6 Essentials

By: Yossi Elkrief

Overview of this book

Android 6 is the latest and greatest version of the Android operating system, and comes packed with cutting edge new features for you to harness for the benefit of building better applications. This step-by-step guide will take you through the basics of the Android Marshmallow permissions model and beyond into other crucial areas such as the Audio,Video,Camera API and Android’s at work features. Learn how to create, deploy, and manage Android applications with Marshmallow’s API and the latest functionalities. The combination of instructions and real-world examples will make your application deployment and testing a breeze.
Table of Contents (16 chapters)
Android 6 Essentials
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

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...