Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Adding at least one Activity with an ACTION-VIEW intent-filter after Updating SDK version 23

I am getting the following tool tip in AndroidManifest.xml:

App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent-filler. See issue explanation for more details.

Adds deep links to get your app into the Google index, to get installs and traffic to your app from Google Search.

enter image description here

Can anyone explain why it is so?

like image 717
Pratik Butani Avatar asked Dec 19 '15 06:12

Pratik Butani


People also ask

What is difference between Intent and Intent filter in Android?

An intent is an object that can hold the os or other app activity and its data in uri form.It is started using startActivity(intent-obj).. \n whereas IntentFilter can fetch activity information on os or other app activities.

What is Android Intent action view?

An intent allows you to start an activity in another app by describing a simple action you'd like to perform (such as "view a map" or "take a picture") in an Intent object.

Can an activity have multiple Intent filters?

If it fails to match even one of them, the Android system won't deliver the intent to the component. However, because a component may have multiple intent filters, an intent that does not pass through one of a component's filters might make it through on another filter.

What triggers an Intent in android?

Android Intent is the message that is passed between components such as activities, content providers, broadcast receivers, services etc. It is generally used with startActivity() method to invoke activity, broadcast receivers etc. The dictionary meaning of intent is intention or purpose.


1 Answers

From official documentation :

To enable Google to crawl your app content and allow users to enter your app from search results, you must add intent filters for the relevant activities in your app manifest. These intent filters allow deep linking to the content in any of your activities. For example, the user might click on a deep link to view a page within a shopping app that describes a product offering that the user is searching for.

Using this link Enabling Deep Links for App Content you'll see how to use it.

And using this Test Your App Indexing Implementation how to test it.

The following XML snippet shows how you might specify an intent filter in your manifest for deep linking.

<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" />         <category android:name="android.intent.category.DEFAULT" />         <category android:name="android.intent.category.BROWSABLE" />         <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->         <data android:scheme="http"               android:host="www.example.com"               android:pathPrefix="/gizmos" />         <!-- note that the leading "/" is required for pathPrefix-->         <!-- Accepts URIs that begin with "example://gizmos” -->         <data android:scheme="example"               android:host="gizmos" />      </intent-filter> </activity> 

To test via Android Debug Bridge

$ adb shell am start         -W -a android.intent.action.VIEW         -d <URI> <PACKAGE>  $ adb shell am start         -W -a android.intent.action.VIEW         -d "example://gizmos" com.example.android 
like image 153
Mk.Sl. Avatar answered Sep 28 '22 06:09

Mk.Sl.