On Android, there are intents for apps as seen here:
https://developer.android.com/guide/topics/manifest/data-element.html
So if I have URL scheme www.google.com/calendar, Calendar app will be opened, etc.
However, I have question where/when this detection happens? I have experienced that tapping on the URL with supported scheme will cause intents recognition and if the scheme is recognised, the associated app will be opened. However, if I do redirection (javascript) to this supported URL in android Chrome, no recognition will happen so no redirection occurs. How can I build the URL in background (by tapping on the button), redirect to that URL and associated app will be opened?
That feature called Deep linking in android. As per document you can see
Open the user's preferred app that can handle the URI, if one is designated.
Open the only available app that can handle the URI.
And for implementation you can refer this link