GOOGLE’S SIX MAGIC LINES OF SEARCH CODE

Welcome to the Weekend Tech Round-up.

With just 6 lines of code in your AndroidManifest.xml file,  Android’s on-device search opens and scours your applications for data.

The lines of code are:

<activity android:name=”.SearchableActivity”>

<intent-filter>

<action android:name=”com.google.android.gms.actions.SEARCH_ACTION”/>

<category android:name=”android.intent.category.DEFAULT”/>

</intent-filter>

</activity>

For developers, this coding technique allows you to integrate power functionalities in a quick and easy way. It gives users a deeper interaction with the app. Your app can receive the SEARCH_ACTION intent containing the SearchManager.QUERY with the search expression once you have implemented the 6 lines of code.

For the rest of us, this means you can perform a simple voice activated search by saying something like “Search Foursquare for a rooftop bar ” and Foursquare will be opened and the search field filled with the data requested. Any user running Google 3.5 or higher on an Android Jelly Bean+ device will be able to use this functionality.

Tags

Related articles

Signs It’s Time to Switch Your SAP Business One Partner

If you’re searching for this, some part of you already suspects the answer. Here’s a structured way to test, not just gut feeling, but specific, observable signs that your SAP Business One partner relationship has actually broken down irreparably, versus the normal bumps every partnership has.

Read more
Contact us

Let's Talk Solutions

Don’t face obstacles alone – tell us about your needs. We’ll listen, suggest options, and together build technology to accomplish your goals.

Guaranteed Follow-Up — Within One Business Day

No chasing. No hassle. It’s easy.

Schedule a Free Consultation
General Form