vcard

Parsing vCard in php

百般思念 提交于 2019-12-08 06:56:41
问题 Hi i want to parse vCard format to a array. User may upload vCard 2,1 or vCard 3.0 i should be able to parse it. I just want the email with names in the vCard in to a php array. i have tried vcardphp.sourceforge.net. <?php require("vcard.php"); $cards = parse_vcards(file('sample.txt')); print_r($cards); function parse_vcards($lines) { $cards = array(); $card = new VCard(); while ($card->parse($lines)) { $property = $card->getProperty('N'); if (!$property) { return ""; } $n = $property-

sync Contacts between iPhone(also Android) and server

∥☆過路亽.° 提交于 2019-12-08 06:05:20
问题 I am in trouble and Need your help. 1st Question: My IOS app has to send/receive datas to/from a Web Server. The server defined using the TCP and the data format is TLV; I have never used TLV before, and have no idea how to solve this problem. As for TCP, I decide to use cocoaAsyncSocket, it's simple to deal with TCP transports; But I send/receive datas all in the (NSData*) format, I don't know if the server can decode it correctly. 2nd Question: I am also trying to sync Contacts between

VCF Vcard import c#

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 03:36:54
问题 iam trying to write a class which imports *.vcf files (Vcard), because i didn´t found a adequate .net class to solve that job. So i decided to treat the *.vcf file like a *.txt file. I just import the whole file, line by line, with a StreamReader. Finally i save the line into a List object. The Code: private List<string> vcardList = new List<String>(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { using (StreamReader reader = new StreamReader(

Address book DB schema

徘徊边缘 提交于 2019-12-08 02:11:56
问题 I need to store contact information for users. I want to present this data on the page as an hCard and downloadable as a vCard. I'd also like to be able to search the database by phone number, email, etc. What do you think is the best way to store this data? Since users could have multiple addresses, etc complete normalization would be a mess. I'm thinking about using XML, but I'm not familiar with querying XML db fields. Would I still be able to search for users by contact info? I'm using

How to retrieve vCard in iOS from XMPP/OpenFire

丶灬走出姿态 提交于 2019-12-07 18:48:29
问题 As the name suggests I am trying to retrieve a vCard for a user using one of the next XMPPFrameworks methods: - (XMPPvCardTemp *)fetchvCardTempForJID:(XMPPJID *)jid; - (XMPPvCardTemp *)fetchvCardTempForJID:(XMPPJID *)jid useCache:(BOOL)useCache; My current implementation is: dispatch_queue_t queue = dispatch_queue_create("queue", DISPATCH_QUEUE_PRIORITY_DEFAULT); dispatch_async(queue, ^{ XMPPvCardCoreDataStorage* xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance];

Getting all contacts as vcard in Android

别来无恙 提交于 2019-12-07 13:45:17
问题 I'm trying to get all of my contacts as vCard. So this is my code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); if (cur.getCount() > 0) { //cur.moveToFirst(); while (cur.moveToNext()) { try{ String lookupKey = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY)); Uri uri = Uri

使用cardme读写VCard文件,实现批量导入导出电话簿

爱⌒轻易说出口 提交于 2019-12-07 09:07:47
首先下载jar包cardme。 http://sourceforge.net/projects/cardme/?source=navbar cardme是基于java语言的操作vCard(后缀vcf)文件的开源项目。 在项目中有一个类net.sourceforge.cardme.engine.TestParser。是官方给的example。 先来梳理几个基本概念 VCardEngine:主要用于从字符、文件中格式化或读取 VCard 数据,并转换为 VCard对象 。 VCardWriter:主要用户把 VCard对象装换为字符,方便写入文件。很难理解的是没有 VCardReader对象。而 VCardEngine对象却做着 VCardReader对象的事儿。 VCard:可以理解为名片。定义了名片的基本协议(接口)。 VCardImpl:名片的实现类。 VCardType:名片的数据。名片的数据都是有类型的比如电话TelType,名字NameType,地址AdrType 基本概念理解了。我们来看看如何使用这些API 第一个需求读取 会使用到 VCardEngine类 主要有如下API parse:是一个 方法 ,方法含义为:从一个文件(或字符)中读取(格式化) VCard对象。如果参数是一个数组,那么多久返回一个 VCard对象 数组 parseMultiple:也是一个重载方法

UTF8 Encoding with vCards in Windows

爱⌒轻易说出口 提交于 2019-12-06 23:44:14
问题 I have implemented a vCard on a website. Problem is though that special characters are not parsed correctly on windows. I can get it to work fine for Mac, but as soon as I open a vcf in Windows (Windows Contacts) it gets messed up. When I open the vcf in Notepad it shows the characters normally. I tried all vcf versions I could find (2.1,3.0,4.0). I used charset-utf-8 in my content-type header (text/x-vcard; charset: utf-8). I used N;CHARSET=utf-8: (and for the other tags). All to no avail.

how to add contacts in telegram-cli by using vcard?

天涯浪子 提交于 2019-12-06 22:50:33
im trying to add my contacts in telegram-cli by using vcard. but when i use this command: import_card <card> nothing happen! it just goes to next line without any error and no contact added. my vcard is VERSION:2.1 how can i improt my contacts to my telegram account by using vcard? Install-Package TLSharp client = new TelegramClient(apiId, apiHash); await client.ConnectAsync(); var phoneContact = new TLInputPhoneContact() { phone = "", first_name = "", last_name = "" }; var contacts = new List<TLInputPhoneContact>() { phoneContact }; var req = new TeleSharp.TL.Contacts.TLRequestImportContacts(

VCF Vcard import c#

佐手、 提交于 2019-12-06 16:29:42
iam trying to write a class which imports *.vcf files (Vcard), because i didn´t found a adequate .net class to solve that job. So i decided to treat the *.vcf file like a *.txt file. I just import the whole file, line by line, with a StreamReader. Finally i save the line into a List object. The Code: private List<string> vcardList = new List<String>(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { using (StreamReader reader = new StreamReader(@"H:\VS.vcf")) { string line; while ((line = reader.ReadLine()) != null) { vcardList.Add(line); } } }