Application integration with Google and Chrome search results

The official Wikipedia app somehow does this, in my app I use a standard intent filter to listen for navigation on Wikipedia URLs.

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

enter image description here

+7
android android-intent google-search google-chrome-app intentfilter
source share
5 answers

According to the documentation , you need to add a meta tag to the pages for which you want the search to show a link to the application, For example, the Wikipedia page linked in the search results from your screenshot has the following link in the 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 application to search for results in other ways. Search results also suggest users to install applications that they donโ€™t have yet. Granting authority to decide which application is offered to someone other than the owner of the page will obviously be dangerous. Another strong hint is that the documentation does not mention alternatives.

+5
source share

As far as I remember, Google announced this year that the API for this will be available with Android L

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

+2
source share

You need to annotate deep links in the HTML markup of your web pages. You can do this in the section for each web page by adding a tag and specifying a deep link as an alternative URI.

See the Wikipedia example (I was looking for the source of the page you were looking for)

 <meta name="generator" content="MediaWiki 1.24wmf15" /> <link rel="alternate" href="android-app://org.wikipedia/http/en.m.wikipedia.org/wiki/Apollo_17" /> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php? title=Apollo_17&amp;action=edit" /> 

You need to add the code below to the web pages:

 <html> <head> <link rel="alternate" href="android-app://com.example.android/example/gizmos" /> ... </head> <body> ... </body> 

Now, in order to process this intention in the application and when you are looking for something, and the link gives you the opportunity to open wikipedia in the application, if you want to support them, you need to change your Android application for this,

First you need to add the schema to your manifest.

Here's how the WikiPedia application works.

The WikiPedia app adds a diagram as shown below in its page browsing activity.

 <activity android:name=".page.PageActivity" > <intent-filter> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="*.wikipedia.org" android:pathPrefix="/wiki/" /> <data android:scheme="https" android:host="*.wikipedia.org" android:pathPrefix="/wiki/" /> </intent-filter> </activity> 

You need to do the same for your domain and this will work. If you need to make sure your application is also shown in deep links, refer to link1 and link2

0
source share

Android is an app api application, integrating your own application into a Google search result. The document says:

 Google web crawling bot (Googlebot), which crawls and indexes web sites for the Google search engine, can also index content in your Android app. By opting in, you can allow Googlebot to crawl the content in the APK through the Google Play Store to index the app content. To indicate which app content you'd like Google to index, simply add link elements either to your existing Sitemap file or in the <head> element of each web page in your site, in the same way as you would for web pages. The deep links that you share with Google Search must take this URI format: android-app://<package_name>/<scheme>/<host_path> The components that make up the URI format are: package_name. Represents the package name for your APK as listed in the Google Play Developer Console. scheme. The URI scheme that matches your intent filter. host_path. Identifies the specific content within your application. The following sections describe how to add a deep link URI to your Sitemap or web pages. 

It is also important that if the user does not have an application on the phone, and you still want the content to be correctly formatted in Google search results , you need to use meta tags. Documents says:

Meta tags are a great way for webmasters to provide search engines with information about their sites. Meta tags can be used to provide information to all clients, and each system only processes meta tags that they understand and ignore. The meta tags are added to the section of your HTML page and usually look like this: this:

refer- https://support.google.com/webmasters/answer/79812?hl=en

0
source share

This is called Application Indexing , and Google has ways to set it up on Android.

Here's how to specify a deep link to the content of your application:

  • In your Android manifest file, add one or more <intent-filter> elements for the actions to be triggered from Google search results.
  • Add a <action> tag that indicates the ACTION_VIEW intent ACTION_VIEW .
  • Add a <data> for each data URI format that takes action. This is the main mechanism for declaring the format for your deep links.
  • Add a <category> for the BROWSABLE and DEFAULT categories.

    • BROWSABLE is required for the intent to be executed from a web browser. Without it, clicking on the link in the browser cannot be allowed for your application, and only the current web browser will respond to the URL.
    • DEFAULT not required if you are interested in deep links to your application from Google search results. However, the DEFAULT category is required if you want your Android application to respond when users click links from any other web page that points to your web site. The difference is that the intent used in the Google search results includes the identity of your application, so the intent clearly indicates your application as a recipient - other links to your site do not know your application identifier, so DEFAULT declares that your application can accept implicit intention.

Example

 <activity android:name="com.example.android.GizmosActivity" android:label="@string/title_gizmos"> <intent-filter android:label="@string/filter_title_viewgizmos"> <action android:name="android.intent.action.VIEW" /> <!-- Accepts URIs that begin with "http://example.com/gizmos" --> <data android:scheme="http" android:host="example.com" android:pathPrefix="/gizmos" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity> 

In this example, your application will respond to deep links such as ...

The intent filter <data> should provide the android:scheme attribute at least. . You can then add additional attributes to further clarify the type of URI that takes the action.

More information can be found here ...

-one
source share

All Articles