One of the extremely forward thinking features of Android is the ability register your app to handle URLs. It'a bit like setting the default application for a file type in Windows, but much more powerful. For one thing, the user isn't harassed immediately after installing your app; they can take your app for a spin before making a difficult-to-reverse decision.
Enabling this feature is very simple. You'll need to specify which types of URLs your app can handle and create an Activity to handle them. Registering for URLs happens in the manifest and there's a ton of flexibility here. You can do it by scheme, domain, port, filetype and path. Be as specific as you absolutely need to be, but no more. I wrote a micro app to handle Youtube short URLs and this is how I matched them:
Here I've specified that I would like to be able to handle any http URLs that begin with "www.youtu.be" or "youtu.be" . The next time the user tries to open one of these URLs, they'd see something like this:
If your app is selected, it will be launched and then it will receive the full URL. How you handle the URL depends entirely on your needs. I only want to expand the shortened URL and then send the expanded URL back out the operating system. This is what I do:
You can see that I get the full Uri that represents the URL by using getIntent().getData(). In my case, I'm only interested in the very last segment, so I grab that and build the full url with it. I then sent out an Intent to the operating system that any other app can try to handle. There's no reason for my app to stick around after that, so I close it.
With a little imagination, you can see how useful this is. You can handle someone else's URLs (as I did) or create an app that handles your own URLs. When your app is installed, you get the super-deluxe native experience, but you can always fall back on the web experience otherwise.
A significantly less useful system would be to use a custom URL scheme (hello, iOS). While you can go this route, keep in mind that clickable hyper-links passed around through email, social media, or messaging apps are now impossible. If you're interested in something like this, it's a better idea to look into defining your own custom Intents. It's a much more expressive system that involves less hackery as the scheme gets more elaborate.