Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating the app with Google search results and Chrome

The official Wikipedia app somehow does that, in my app I'm using a standard intent-filter to listen for navigation to Wikipedia urls.

Is there a way to integrate with Google search? Are there any APIs available, or is this only available for the chosen ones?

enter image description here

like image 664
animaonline Avatar asked Jul 29 '14 08:07

animaonline


People also ask

Can I use Google Search in my app?

Today, we're introducing a new way for you to search for information in your apps on your Android phone. With this new search mode, called In Apps, you can quickly find content from installed apps. To access this feature, go to the Google app on your Android phone and find the In Apps tab.


2 Answers

According to the documentation, you have to add a meta tag to the pages for which you want the search to display a link to an app. For example, the Wikipedia page linked in the search result from your screenshot, has the following link in its source code:

<link rel="alternate" href="android-app://org.wikipedia/http/en.m.wikipedia.org/wiki/Apollo_17" />

I assume that you cannot add a link to your app to search results by other means: The search results also suggest users to install apps they don't have yet. Giving the power to decide which app is suggested to someone other than the owner of a page would obviously be dangerous. Another strong hint is that the documentation does not mention any alternatives.

like image 194
Phillip Avatar answered Oct 06 '22 01:10

Phillip


As I remember correctly Google announced in this years Google I/O that an API to achieve this will be available from Android L

The announcement can be found in the keynote video at 33:45, although it does not say anything about how it will work

like image 32
pshegger Avatar answered Oct 06 '22 00:10

pshegger