install android studio

How to insert Voice Search in Android app

Voice Search :

Voice search is one of the most useful tool which is frequently used by people in today’s life . It provides the ease to the people by speaking the query instead of writing for it.

The survey tells us that today’s 51% of teens are used voice search and 44% of adults are used voice search . Voice Recognition recognises the speech into text and then tranfer this text as a search query for the further process.

To embed the voice search  in android apps we have to implement following steps in the project which are :

1. ANDROID MANIFEST.XML :

<activity android:name="SearchActivity">
<intent-filter>
<action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>

2. Main.java :


Intent intent = getIntent();
if(SearchIntents.ACTION_SEARCH.equals(intent.getAction())){
String query= intent.getStringExtra(SearchManager.QUERY);
doMySearch(query);
}
}

 

About the author

Generic Bytes

Hi! we are from Generic Bytes an aspiring bloggers with an obsession of things tech.This blog is dedicated to people who want to learn the technology.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *