I'm trying to create a link on my website where you can click and add my info to your phones contacts. Is there a file format that android will recognize & load a contact from?
1 Answers
The easiest way is to use a barcode you could e.g. create with an app like My QR code Generator. If you do not want to install an app for the purpose, there are also web services available like e.g. GOQR.ME -- simply search google for QR Code generator vcard.
The result is a QR-Code -- a simply image you can put on your web page. On Android (and other) devices, a QR code reader (best known and widely used on Android is Barcode Reader) utilizes the camera to take a picture from it, analyzes the coded content, and then offers an appropriate action. In case of a VCard, this would e.g. be to add it to your contact list -- exactly what you intended.
Of course you could simply export your contact data in VCard format for download (on opening that, the user would get the same choice to add the content to the contacts). You also could combine both, linking the QR-Code image to the downloadable VCard (make sure the file extension of the vcard file is set to .vcf
, so the web server gets a chance to set the correct mime type -- otherwise it may be treated as "plain text" and opened inside the browser instead of being downloaded). This way a visitor could either use a barcode reader, or click on the code to download the VCard. Thus it even could be imported to apps on the PC: MS Outlook, Gnome Evolution, and others understand the VCard-Format as well.
Troubleshooting:
If you linked the VCard .vcf
file for download, and it still only gets displayed in the browser window, here's how this can be fixed with Apache web server (solution by MrGlass -- thanks!):
Edit your Apache config (or, if you cannot access this, edit/create the .htaccess
file in the directory your .vcf
is stored) to contain the following segment:
<FilesMatch "\.vcf$">
ForceType text/vcard
Header set Content-Disposition attachment
</FilesMatch>

- 91,166
- 73
- 343
- 943
text/vcard
ortext/x-vcard
) would help as well. Maybe Apache didn't recognize it by the chosen file-ext -- did you name it something with.vcf
(just added that part to my answer above)? – Izzy Jul 11 '12 at 14:44<FilesMatch "\.vcf$"> ForceType text/vcard Header set Content-Disposition attachment </FilesMatch>
in htaccess seems to fix things – MrGlass Jul 11 '12 at 14:51