On Fri, Feb 12, 2016 at 4:39 AM, MarKco <[email protected]> wrote:
> Hello everyone. Sup, bra. > Also, I wrote a content provider in order to parse the URI You don't need a content provider for this and it's likely just to add confusion and complexity. > But I wonder: what should I do? Get data from the intent with a > > getIntent().getData().getQuery() > or use the ContentProvider and get them from the URI? Get the data from the intent. > Now, in the "testing your app" section of the documentation I saw that the > links like http://hotelsclick.com?hotel_id=135738 > <http://hotelsclick.com/?hotel_id=135738> are referred as "deep links" > while those like android-app://com.towers.hotelsclick/https/ > hotelsclick.com?hotel_id=135738 <http://hotelsclick.com/?hotel_id=135738> > are referred as "URI". Am I right? No. Both of those are actually both URIs and deep links. URIs: specially formatted strings that uniquely describe some resource. Deep links: a special case of URI that your app can handle to navigate to a specific location within your app. The thing prefixed with "android-app" is specifically an "App URI" and is used for App Indexing. It's what you use to register a piece of content that was viewed from within your app with Google. > The "View as google" funcionality asks for a URI but I don't know how to > create one. I'm assuming you mean "Fetch as Google" in the Search Console. Follow the docs: https://support.google.com/webmasters/answer/6178089 You'd just paste "http://hotelsclick.com?hotel_id=135738 <http://hotelsclick.com/?hotel_id=135738>" into the box and hit "Fetch" to verify Google can crawl your app. If you've set everything up correctly, it should be able to crawl your app successfully. Also, I wonder how this URI is passed to the app and I'm pretty sure I'm > getting very confused about this all URI/deepLink thing, and can't find > relief in the documentation. Once you've registered in your manifest that a given activity handles a given URI, the system will route links matching that pattern to your app. Once you've set up App Indexing using the App URI, searches from the Google App on an Android device will directly open your app to view the relevant content. Where and when should I use the URI? Your App URI is used in registering content for App Indexing. See: http://developer.android.com/tools/help/app-link-indexing.html > Where and when should I use the deepLink? A deep link is not something you use, per se. It's something you handle when it's given to you by the system. > I guess that since I'm going to put the link rel=URI in my webpages then > the app will be called in the app indexing with the URI and not with the > URL of the page. Although the docs mention adding these alternate links, I didn't find them necessary. > But if it's so... why is the adb shell am start -a > android.intent.action.VIEW -d command used for testing with the URL and not > the URI? Because the system launches your app with standard format URLs. The App URI is a special thing used by App Indexing which you will never receive. > Should my app be able to get and handle URIs or URLs? And how? Your app only cares about URLs using the standard intent filtering mechanism that's been in Android since the beginning of time. I thought I had understood something about app indexing, but today I'm > starting to think I got it all wrong since I started. That's why I ask you > for help in answering the questions above, and possibly sheding a light on > all this URL/URI/intent-filter/ContentProvider mess. There's definitely a lot of pieces here and Google's tradition of using shitty names for things certainly doesn't help. Make sure you've run through these main pages of documentation: https://developers.google.com/app-indexing/introduction#android http://developer.android.com/training/app-indexing/index.html http://developer.android.com/tools/help/app-link-indexing.html > Thank you everybody Sure thing. Stay frosty. ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/CANCScggDhrVk%3Driq_V76-7iNh7aqua5gBAz7dmTzePTiFqc_zg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

