I'm trying to add a vCard from a web link to the user's contact list on Android 2.2. When I direct the user to .vcf file, all I get is text output in the mobile browser. I have confirmed that the files is being transferred with MIME type text/v-card. This seems like it should be pretty simple to do. Any ideas?
8 Answers
Just to let you know: I just tried it using a vCard 2.1 file created according to the vCard 2.1 spec. I found that vCard 2.1, despite being an old version, already covered everything I needed, including a base64-encoded photo and international character sets.
It worked perfectly on my unmodified Android 4.1.1 device (Galaxy S3). It also worked on an old iPhone 3GS (iOS 5, via the Evernote app) and a coworker's unmodified old Android 2.1 device. You only need to set the Content-disposition
to attachment
as suggested above.
A minor problem was that I triggered the VCF download using a QR code, which I scanned with the Microsoft Tag app. That app told me Android couldn't handle the text/x-vcard
media type (or just text/vcard
, no matter). Once I opened the link in a Web browser (I tried Chrome and the Android default browser), it worked fine.

- 16,865
- 10
- 85
- 132
AFAIK Android doesn't support vCard files out of the Box at least not until 2.2.
You could use the app vCardIO to read vcf files from your SD card and save to you contacts. So you have to save them on your SD card in the first place and import them afterwards.
vCardIO is also available trough the market.

- 24,084
- 23
- 95
- 173

- 928
- 10
- 8
-
10The best solution I have found is to force the download by setting the content-disposition to attachement for .vcf files in an Apache httpd.conf or .htaccess file. The user then has to open the file and they are asked how they want the contact info to be inserted into their contact list. This thread helped a lot: http://code.google.com/p/android/issues/detail?id=9215 – ARolek Dec 08 '10 at 06:56
There is now an import functionality on Android ICS 4.0.4.
First you must save your .vcf
file on a storage (USB storage, or SDcard).
Android will scan the selected storage to detect any .vcf
file and will import it on the selected address book.
The functionality is in the option menu of your contact list.
!Note: Be careful while doing this! Android will import EVERYTHING that is a .vcf
in your storage. It's all or nothing, and the consequence can be trashing your address book.

- 4,052
- 4
- 37
- 42

- 41
- 1
This can be used to download the file to your SD card Tested with Android version 2.3.3 and 4.0.3
======= php =========================
<?php
// this php file (example saved as name is vCardDL.php) is placed in my html subdirectory
//
header('Content-Type: application/octet-stream');
// the above line is needed or else the .vcf file will be downloaded as a .htm file
header('Content-disposition: attachment; filename="xxxxxxxxxx.vcf"');
//
//header('Content-type: application/vcf'); remove this so android doesn't complain that it does not have a valid application
readfile('../aaa/bbb/xxxxxxxxxx.vcf');
//The above is the parth to where the file is located - if in same directory as the php, then just the file name
?>
======= html ========================
<FONT COLOR="#CC0033"><a href="vCardDL.php">Download vCARD</A></FONT>
-
Now you can use `header("Content-type: text/x-vcard; charset=utf-8") ` for header – Zortext Jun 18 '20 at 10:47
I had problems with importing a VERSION:4.0
vcard file on Android 7 (LineageOS) with the standard Contacts app.
Since this is on the top search hits for "android vcard format not supported", I just wanted to note that I was able to import them with the Simple Contacts app (Play or F-Droid).

- 1,157
- 15
- 20
-
Thank you for this! It worked great. Note that root is required to install this app from F-Droid as its a split APK. I imported my ProtonMail contacts using this method – j7m Feb 11 '19 at 07:30
I'm running 2.2 and there is no change, reports from others on 2.3 say the same. Android (bug) does not handle a .vcf nor a link to such a file on a web page via port 80, neither via http headers or direct streaming. It just is NOT SUPPORTED AT ALL.

- 21
- 1
-
After trying to get this to work, this is my experience of Android, upto and including 4.0, as well.... – Andrew Mackenzie Mar 29 '12 at 17:09
-
I know this is an old answer but someone mights stumble upon it: Likely has to do with OEM versions and features they add. – Mgamerz Dec 11 '12 at 18:53
What i have also noticed is that you have to save the file as Unicode
, UTF-8
, no BOM
in an Windows format with CRLF
(Carriage Return, Line Feed). Because if you don't, the import will break. (Saying something about weird chars in the file)
Good luck :) Sid

- 24,084
- 23
- 95
- 173

- 11
- 1
It took me 2 days to find a php library for generating vcf files that is genuine you can try this library. It worked for my project hopefully it may work for yours too :)

- 811
- 9
- 25
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 09 '22 at 15:17