Setting Defaults for Links I've been confused about how this works for quote some time now-- when I click a link, say in a browser (Chrome for example) and get the "open with" dialog if you will, if I chose to save a default for a Google maps link, will that set the default to ALL Google maps links, that particular link, or am I missing something?

I'm often afraid to set defaults because I'm not clear on what it is I'm actually setting a default for-- is it the domain name?

I'd appreciate any tips, links to documentation, or app suggestions to make this clearer to me. Thanks!
Short answer: yes, it's for all Google Maps links.

The long answer is that Android's intent mechanism (which is the way Android decides what app to start) can use different parts of the URL to match the app. The app can register itself with Android to handle:


a particular URI scheme, such as market://
a particular domain, such as youtube.com
paths within the domain matching a particular filter, such as /users/*


Apps can also filter on other things not relevant to clicking a link, such as different actions (e.g. share) or different MIME types. One app can have more than one filter, and one filter can match any combination of the above things. For example, a YouTube app might have one filter that matches when all these conditions are met:


the scheme is http:// or https://
the domain is youtube.com
the path matches watch?v=*


and another that matches when all these conditions are met:


the scheme is http:// or https://
the domain is youtu.be (the domain for short URLs)


In this case, there are two different defaults to set: the first time you click a link http://www.youtube.com/watch?v=DJRFaR71HfY it will set the default for that kind of link. Then, if you later click a http://youtu.be/DJRFaR71HfY, it'll ask a second time, because that counts as a different kind of link.

In the case of Google Maps, there are several different kinds of link it can handle (as well as other intent filters not relevant to links):-


geo://*
latitude://*
http://maps.google.tld/ or https://maps.google.tld/ (with nothing after the /), for every TLD that Google has (google.com, google.fr, etc.)
http://maps.google.tld/maps* or https://maps.google.tld/maps*
http://mapy.google.pl/ or https://mapy.google.pl/ ("mapy" being Polish for "maps")
http://mapy.google.pl/maps* or https://mapy.googl.pl/maps*
http://local.google.com/ or https://local.google.com/
http://local.google.com/maps* or https://local.google.com/maps*
http://m.google.com/latitude or https://m.google.com/latitude
http://www.google.com/latitude or https://www.google.com/latitude
http://m.google.com/u/m/* or https://m.google.com/u/m/*


Each one of those lines counts as a different kind of link, so Android will ask again. In addition, all but the first of those have two separate entries: one for opening or browsing a link in the usual way, and another for scanning an NFC tag (or receiving by Android Beam) a matching link. Again, those two things count as different links for the purposes of setting defaults.



To get this information from the Google Maps app, I used the app PackageExplorer. The information it gives you takes some knowledge to interpret: you may find the Android intent API guide for developers useful.