3

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!

  • I'm not 100% sure whether I understood you correctly. You are not asked for every link (most should simply open the linked page in your browser), are you? This should only happen for targets the browser cannot handle itself, and then you can set the default app to handle that mime type, regardless of the domain/website/page it comes from. Basically, it's saying "Open MP3 files always with [my player], don't ask me again to chose", for example. – Izzy Sep 20 '13 at 6:39
  • 1
    @Izzy It's not only for targets the browser cannot handle itself: it's for any URL where more than one app can handle it. YouTube links are the usual example. For web links, it's usually the URL rather than the MIME type, because the browser doesn't know the MIME type until you follow the link. – Dan Hulme Sep 20 '13 at 11:38
  • Good example – you're absolutely right! I just cannot remember that happening for "normal" links (text/html) when multiple browsers are available, so that seems to be an exception somehow? – Izzy Sep 20 '13 at 12:33
4

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.

  • Thanks for the thorough information, Dan! Do you have any suggestions for managing or showing this level of detail easily on the phone? I've seen an asp called Default Manager, but from the reviews I've seen, it doesn't appear to be a viable solution. – Kurt Sep 20 '13 at 18:47
  • @Kurt I'd suggest not bothering. Unless you're writing your own app or something like a Tasker script that needs to interoperate with this specific app, it's easier to just let the system work as designed. Even so, I updated my answer to add this information. – Dan Hulme Sep 21 '13 at 8:25
  • Do you have an alternative link for PackageExplorer? The current one is dead. – Firelord Sep 11 '15 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.