1

I have an android application. I want to implement App Indexing for my App.

I have followed the Google developer links

https://developers.google.com/app-indexing/android/publish

https://developers.google.com/app-indexing/reference/deeplinks

https://developer.android.com/training/app-indexing/deep-linking.html

https://support.google.com/googleplay/android-developer/answer/6041489

I got to know few things from the links

  1. I need to verify my website

  2. Use app indexing API in my Activity

The things that I did not understand

  1. What is the website should I verify?

  2. what should I give for APP_URI & WEB_URL?

      static final Uri APP_URI = Uri.parse("android-app://com.example.android.recipes/http/recipe-app.com/recipes");
      static final Uri WEB_URL = Uri.parse("http://recipe-app.com/recipes/");
    
  3. What is the Schema to host my links?

     android-app://{package_name}/{scheme}/{host_path}
    
  4. What is the 'data' should I give in Manifest file.

Think I'm very New to to android development. Any examples are most helpful. Thanks in Advance.

Pushpa
  • 892
  • 1
  • 12
  • 30

2 Answers2

3

So you already started well using Google's provided example to better understand how App-Indexing works. With that covered, I'd recommend you to follow also the best pratices present here:

https://developer.android.com/training/app-indexing/index.html .

Now, answering to your points:

1- As you saw with Google's example, it is required that your App has corresponding content on the web that has also been indexed by Google. In this case, the website is:

http://recipe-app.com

It would be best if you verify both the app & the website. Information on how to associate your website to your App is present in https://developers.google.com/app-indexing/android/publish

Currently App-Indexing only supports Apps that have correspondent websites. However, if you don't have a website you can still show your interest in support App-Indexing in your App by submitting this form https://developers.google.com/app-indexing/app-only .

2- Google advises to use the App-Indexing API and the HTTP intent scheme as best practices, so in this case you will only need the APP_URI. Also with this kind of implementation, you would not need to make any change on the website markup or sitemap. So in each of your App page you should indicate the APP_URI with the URI of the correspondent content in your website.

3- Assuming you're using the HTTP scheme, your deep link would be similar to this:

android-app://my.app.apk/http/mywebsite.com/sub-domain/content1.html

4- The data parameter on your app's manifest file is where you define the deep link intents that your app supports, so using the example of deep link I provided on 3), it should be similar to this:

<data android:scheme="http"
           android:host="mywebsite.com"
           android:pathPrefix="/sub-domain" />

This intent will support any web URL that start by:

http://mywebsite.com/sub-domain/

Hope this helps.

Stan Ct
  • 366
  • 1
  • 6
0

I think it would be better as follow:

android-app://my.app.apk/http/sub-domain.mywebsite.com/content1.html
Mark
  • 21
  • 4