title: Deep linking via Google Search - how it works, and what to put in the manifest?
body: <h2>Background</h2>
  
  <p>I need to investigate how to integrate with the new (?) Google search deep linking feature.</p>
  
  <h2>The problem</h2>
  
  <p>This seems like a relatively new feature that's still not so popular, so I can't find a lot of resources about how it works and how to configure it correctly.</p>
  
  <h2>What I've tried</h2>
  
  <p>I've read some websites of Google  and watched some of its videos:</p>
  
  <ul>
  <li><a href="https://www.youtube.com/watch?v=kYLrK-gD2Yg" rel="nofollow">https://www.youtube.com/watch?v=kYLrK-gD2Yg</a></li>
  <li><a href="https://www.youtube.com/watch?v=UjLJoMWSXts" rel="nofollow">https://www.youtube.com/watch?v=UjLJoMWSXts</a></li>
  <li><a href="https://developers.google.com/app-indexing/webmasters/app" rel="nofollow">https://developers.google.com/app-indexing/webmasters/app</a></li>
  <li><a href="https://support.google.com/googleplay/android-developer/answer/6041489" rel="nofollow">https://support.google.com/googleplay/android-developer/answer/6041489</a></li>
  <li><a href="https://developers.google.com/app-indexing/webmasters/appindexingapi" rel="nofollow">https://developers.google.com/app-indexing/webmasters/appindexingapi</a></li>
  <li><a href="https://developers.google.com/app-indexing/" rel="nofollow">https://developers.google.com/app-indexing/</a></li>
  <li><a href="https://plus.google.com/+AppIndexing/posts" rel="nofollow">https://plus.google.com/+AppIndexing/posts</a></li>
  <li><a href="http://googlewebmastercentral.blogspot.co.il/2014/06/android-app-indexing-is-now-open-for.html" rel="nofollow">http://googlewebmastercentral.blogspot.co.il/2014/06/android-app-indexing-is-now-open-for.html</a></li>
  </ul>
  
  <p>from what I understand, I need to register the app, change the data (intent handling) in the manifest for an activity, and change the code of the activity too, but I'm not sure I understand how it all works and what's the best way to configure it.</p>
  
  <h2>The questions</h2>
  
  <p>Even after that much reading, I would still like to ask some questions about deep linking using Google Search:</p>
  
  <ol>
  <li><p>First, the basic question, to verify that I know what it's all about: It lets apps to be indexed via the "Google Search" app, but those apps must be installed too. Once the user clicks an item within "Google Search" app, it goes to your app and you get the query. Is this correct? Is there anything more than that?</p></li>
  <li><p>They wrote that minSdkVersion should be 17 or below (<a href="https://developers.google.com/app-indexing/webmasters/app" rel="nofollow">here</a>). How come it's "or below" instead of "or above" ? </p></li>
  <li><p>For some reason, the query of the examples (like <a href="https://youtu.be/aISUYHTkTOU?t=76" rel="nofollow">here</a>) are of just simple texts, but the app is shown there. Why is it shown? What in the manifest tells Google-Search that the app can handle this query? The code examples show URLs ...</p></li>
  <li><p>Is it possible to test the deep linking via Google Search without registering it (<a href="https://support.google.com/googleplay/android-developer/answer/6041489" rel="nofollow"><strong>here</strong></a>) ? All I've found is how to test it via adb, but I don't understand where in the example (<a href="http://developer.android.com/training/app-indexing/deep-linking.html#testing-filters" rel="nofollow"><strong>here</strong></a>) is the query that the user enters.</p></li>
  <li><p>Do the deep linking require an actual website that users can visit via the web browser ? I ask this because there is a step called "Verify website" when registering to the service (<a href="https://support.google.com/googleplay/android-developer/answer/6041489" rel="nofollow"><strong>here</strong></a>) .</p></li>
  <li><p>Suppose I want to allow the user to search for a phone number via the app. Should I put "tel:" in the "scheme" (as shown <a href="http://en.wikipedia.org/wiki/URI_scheme#Official%5FIANA-registered%5Fschemes" rel="nofollow"><strong>here</strong></a>) part inside the manifest? Or is it something else(or more than that)? Would Google-Search know exactly when to show the app (for example, when the phone number is valid)?</p></li>
  <li><p>Is it possible to use this feature in case the app isn't installed, so that it would encourage people to download the app, and/or search via a real website?</p></li>
  <li><p>Even when trying to test it, I've failed. Manifest:</p>
  
  <pre><code>    &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.VIEW" /&gt;
          &lt;!--should match to : https://somehost/search/?number=--&gt;
          &lt;data android:scheme="https"
                android:host="somehost"
                android:pathPrefix="/search/?" /&gt;
          &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
      &lt;/intent-filter&gt;
  </code></pre></li>
  </ol>
  
  <p>code:</p>
  
  <pre><code>    Intent intent = getIntent();
      String action = intent.getAction();
      Uri data = intent.getData();
      Log.d("AppLog", "action:"+action+" data:"+data);
  </code></pre>
  
  <p>adb command (from <a href="http://developer.android.com/training/app-indexing/deep-linking.html" rel="nofollow"><strong>here</strong></a>) :</p>
  
  <pre><code>adb shell am start -W
  -a android.intent.action.VIEW -d "somehost/search/?050" com.example.user.myappli
  cation
  Starting: Intent { act=android.intent.action.VIEW dat=somehost/search/?050 pkg=c
  om.example.user.myapplication }
  Error: Activity not started, unable to resolve Intent { act=android.intent.actio
  n.VIEW dat=somehost/search/?050 flg=0x10000000 pkg=com.example.user.myapplicatio
  n }
  </code></pre>
  
  <p>I've even tried the exact sample, but with a different package name, and it still didn't work.</p>
  
  <p>What's wrong here?</p>