Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I send vcard/contacts/?vcf var SMS or MMS in Android?

I want to modify the Android source code that can send (contacts/vcard/.vcf file) by MMS or SMS, the Android default way is through Bluetooth. I find a lot of ways, but it all doesn't work. I know the vcf format is like this:

BEGIN:VCARD
VERSION:2.1
N:;lybeen;;;
FN:lybeen
TEL;CELL;
PREF:1-123-234-1234
TEL;CELL:000-111-1111
END:VCARD

I send this string by SMS as a plain message. Some Android phone can recognize this as a contact, however, most of the Android phone can not recognize, but I don't know how to send the contacts by MMS.

like image 681
lybeen Avatar asked Dec 01 '25 14:12

lybeen


1 Answers

though i think i am late in answering the question, whether it will help the OP or not, but it will always be helpfull for the future visitors.

To send Vcard through mms, you just need to attach the .vcf file with the system's intent.

            Intent sendIntent = new Intent(Intent.ACTION_SEND);
            sendIntent.setType("text/x-vcard");
            sendIntent.putExtra(Intent.EXTRA_STREAM,
                    Uri.fromFile(outputFile));
            startActivity(sendIntent);
like image 84
Sahil Mahajan Mj Avatar answered Dec 06 '25 04:12

Sahil Mahajan Mj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!