vcard

How to generate a .vcf file from an object which contains contact detail and object is not in the phone book

淺唱寂寞╮ 提交于 2019-12-03 13:00:49
问题 I want to generate a .vcf file for an object which contains contact information like name, image, phone number, fax number, email id, address etc. This object is not added in the address book of the phone but it is stored in my application. Once my .vcf file is generated I can send this vcard like this Intent i = new Intent(); i.setAction(android.content.Intent.ACTION_VIEW); i.setDataAndType(Uri.parse("**generated.vcf**"), "text/x-vcard"); startActivity(i); But I am not getting how to get

Read/Parse Data from vCard

蓝咒 提交于 2019-12-03 08:48:06
Is there any framework/library available in iOS SDK to read/parse data in vCard format? I am receiving data in a vcard format in a NSString and I have to parse it. Googled a lot, but couldn't find solution yet. BEGIN:VCARD VERSION:2.1 N:LastName;FirstName;MiddleName;Prefix;Sufix ADR;TYPE=HOME: postbox;street2;street1;city;state;zip;country BDAY:2010-08-19 END:VCARD Master Stroke I did found some solutions for you... Have a look at the following links... 1) Want ready made sample code==> Click here 2) Writing to Vcard==> Click here Code Relevent to you: ABAddressBookRef addressBook =

Vcard parser with Python

核能气质少年 提交于 2019-12-03 08:33:11
I am parsing my vcard info (copied to a txt file)to extract name:number and put it into a dictionary. Data sample: BEGIN:VCARD VERSION:2.1 N:MEO;Apoio;;; FN:Apoio MEO TEL;CELL;PREF:1696 TEL;CELL:162 00 END:VCARD BEGIN:VCARD VERSION:2.1 N:estrangeiro;Apoio MEO;no;; FN:Apoio MEO no estrangeiro TEL;CELL;PREF:+35196169000 END:VCARD import re file = open('Contacts.txt', 'r') contacts = dict() for line in file: name = re.findall('FN:(.*)', line) nm = ''.join(name) if len(nm) == 0: continue contacts[nm] = contacts.get(nm) print(contacts) With this I am getting a dictionary with names but for numbers

Asmack not loading VCard

断了今生、忘了曾经 提交于 2019-12-02 04:23:21
I am using a binary release of Asmack (I will be building it as soon as I have some time as I had problems the first time I tried). I also set up my own ejabberd server. When I try to load some contact VCard the server returns the info but Asmack does not seem to like it (or fail to parse it). This is what I can see in debug mode: <iq from='user@domain' to='admin@domain/Smack' id='I17sI-4' type='result'> <vCard xmlns='vcard-temp' prodid='-//HandGen//NONSGML vGen v1.0//EN' version='2.0'> <FN>Full Name</FN> <N> <FAMILY>Surname</FAMILY> <GIVEN>Nick</GIVEN> </N> <NICKNAME>Nickname</NICKNAME> <URL

Android: How to save contacts to sdcard as vCard. Without duplicates?

天涯浪子 提交于 2019-12-01 21:05:12
I am trying to save all of the contacts on a phone to the sdcard as a .vcf file (vCard). It works, but I have a problem. Every contact that has more than one phone number (a mobile and work number) are saved twice. And both of the numbers are in each duplicate contact, so they are correct, just duplicated. Can someone please tell me how to fix this problem? My code is: File delete=new File(Environment.getExternalStorageDirectory()+"/Contacts.vcf"); if (delete.exists()) { delete.delete(); } Cursor phones = ContactService.this.getContentResolver().query(ContactsContract.CommonDataKinds.Phone

Aggregate Contacts are added automatically?

北战南征 提交于 2019-12-01 12:06:52
问题 you must have seen this piece of code somewhere else too,but obviously there's no answer for this exception. EDIT: IF You've come here finding a solution to restoring contacts via vcardio.This is IT!! I got this while utilising the vCardIO api for android used to restore contacts from vcard to the contacts db.I have been using the following doImport() method which is supposed to work just fine,but it isnt! public void doImport(final String fileName, final boolean replace) { try { File vcfFile

In Android 7, ContentResolver's method-openAssetFileDescriptor(vCardUri, “r”) returns AssetFileDescriptor having declaredLength as -1

雨燕双飞 提交于 2019-12-01 11:04:55
In Android 7, getContentResolver().openAssetFileDescriptor(vCardUri, "r") returns AssetFileDescriptor having declaredLength as -1 returned by getDeclaredLength() . Trying to export the contacts as vcards into vcf file. The code I have tried is as follows Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey); AssetFileDescriptor fd = resolver.openAssetFileDescriptor(uri, "r"); FileInputStream fis = fd.createInputStream(); byte[] b = new byte[(int)fd.getDeclaredLength()]; fis.read(b); The above code works perfectly in Android 6 or below.But when ran using Android

In Android 7, ContentResolver's method-openAssetFileDescriptor(vCardUri, “r”) returns AssetFileDescriptor having declaredLength as -1

我怕爱的太早我们不能终老 提交于 2019-12-01 09:40:01
问题 In Android 7, getContentResolver().openAssetFileDescriptor(vCardUri, "r") returns AssetFileDescriptor having declaredLength as -1 returned by getDeclaredLength() . Trying to export the contacts as vcards into vcf file. The code I have tried is as follows Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey); AssetFileDescriptor fd = resolver.openAssetFileDescriptor(uri, "r"); FileInputStream fis = fd.createInputStream(); byte[] b = new byte[(int)fd

how to programmatically send business card messages to mobile phone via internet

空扰寡人 提交于 2019-12-01 00:47:22
Is it possible to send messages from internet in business card formats. ? I need to send a contact to a mobile phone so that the recipient can save the contact easily. using sms api s we can send sms but how to send business card files ? In my project scenario I have telephone numbers of 10 persons which I need to send the numbers to another mobile phone in business card format. Any ideas on how to implement ? vCard is a file format standard for electronic business cards. vCards are often attached to e-mail messages, but can be exchanged in other ways, such as on the World Wide Web or Instant

How can I prevent bad inputs when storing phone numbers as strings?

佐手、 提交于 2019-11-30 23:05:32
I am creating a phonebook program that can read VCards. The problem is with phone numbers. Normally, they will be like this in the United States: 0771234560 But if the phone number is from a foreign country, it would look like this. +94771234560 or maybe (22)772324000 Now there are + and () signs to deal with! I am currently converting phone numbers (VCards contain them as Strings) to numbers. However, if I take allow phone numbers as strings, then a user could do something crazy, like insert a name as a phone number in the contact form. How can I store phone numbers as strings but prevent