Make a link in the Android browser start up my app?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
If you want a browser link to open your Android app, you need deep linking. Android can route a matching URL to an activity in your app, either through a custom scheme such as myapp:// or through verified HTTPS App Links.
For production apps, verified HTTPS links are usually the better option. They behave more like normal web URLs, work better with user trust, and avoid collisions with other apps that might claim the same custom scheme.
Basic Deep Link with an Intent Filter
The entry point is an intent filter in AndroidManifest.xml. It declares which URL pattern your activity can handle.
With that manifest entry, a link such as myapp://product?id=42 can start the activity. Inside the activity, read the incoming URI from the launching intent.
Use Android App Links for Real Web URLs
Custom schemes are easy to set up, but App Links are better when the link should also work on the web. They use normal HTTPS URLs and let Android verify that your domain trusts your app.
Manifest example:
Then publish an assetlinks.json file on your domain at https://example.com/.well-known/assetlinks.json.
Once verified, tapping https://example.com/products?id=42 can open the app directly.
Handle Fallbacks Gracefully
Not every user will have the app installed. That is another reason HTTPS links are useful: the same URL can open the website when the app is missing.
Your application code should also validate the incoming URI. Treat it like external input. Check path segments, query parameters, and authentication state before navigating to sensitive screens.
If the target screen depends on login, redirect unauthenticated users through your normal sign-in flow and then continue navigation after authentication succeeds.
Test the Link Flow
Use adb to simulate opening a link from the browser.
This is faster than repeatedly sending yourself emails or chat messages just to tap links. It also makes debugging intent filters much easier.
Common Pitfalls
- Using a custom scheme when an HTTPS App Link is the better fit. Custom schemes are easier to collide with and less trustworthy to users.
- Forgetting
BROWSABLEin the intent filter. Without it, browser links will not open the activity. - Publishing the wrong signing certificate fingerprint in
assetlinks.json. Verification fails silently more often than people expect. - Assuming every incoming URI is safe. Deep links are external input and should be validated before navigation.
- Testing only on one Android version. Link handling behavior has changed across releases and OEM builds.
Summary
- Android opens apps from browser links through deep links and App Links.
- Custom schemes are simple, but verified HTTPS App Links are usually the production choice.
- The manifest intent filter defines which URLs the app can receive.
- '
assetlinks.jsonis required for domain verification with App Links.' - Test with
adband validate all incoming URI data before acting on it.

