I wanted to import a virtual contact file (.vcf) (with a single person's details on it) directly using Android's native contact import activity without downloading it first using the browser. This all had to be done when a user clicked on a link in their device's browser (e.g., Google Chrome).
Usually when a user clicks on the link, it downloads a virtual contact file (.vcf) on their system (for e.g., Android). I wanted to bypass this behaviour and open the intent directly, which the user would have fired manually by navigating to the file (.vcf) and clicking on it.
I tried looking at several questions asked here, such as:
- Android how is a Chrome intent-based URI opened
- What is the intent to launch any website link in Google Chrome
- Launching Intent through Chrome with data
- Adding Contacts to phone via JS
I also checked out Google's guide on Android Intents with Chrome in Chrome for Android subsection. Available here, last updated on February 28, 2014.