Where to find a java library to read vcard files? [closed]

删除回忆录丶 提交于 2019-11-27 01:55:49

问题


I need a java library to read vcard files (vcf).


回答1:


A search for Java and vcard yields quite a few results.

In particular there's the Mime-Dir-j which is no longer under active development, but may be all you need, and vcard4j which seems to have been dormant for even longer (last release 2003!).




回答2:


ez-vcard supports versions 2.1, 3.0, and 4.0 of the vCard standard, as well as XML-encoded vCards ("xCard" standard), HTML-encoded vCards ("hCard" microformat), and JSON-encoded vCards ("jCard" standard).

https://github.com/mangstadt/ez-vcard

To read a vCard file, use the Ezvcard.parse() method. Then, call the various getter methods on the returned VCard object to retrieve the vCard data fields.

File file = new File("my-vcard.vcf");
VCard vcard = Ezvcard.parse(file).first();
System.out.println("Name: " + vcard.getFormattedName().getValue());
System.out.println("Email: " + vcard.getEmails().get(0).getValue());



回答3:


Cardme seems to be the best vcard library around with active development and there is even a wiki site up.

Check the project homepage.




回答4:


Haven't used it yet (about to try it out), but this looks promising.

http://code.google.com/p/android-vcard/




回答5:


http://wiki.modularity.net.au/ical4j/index.php?title=VCard




回答6:


I found this API that might do the trick: http://sourceforge.net/projects/mime-dir-j/




回答7:


Try Google, Yahoo, whatever and find http://vcard4j.sourceforge.net/




回答8:


Well, just in case you want to use a mobile phone, JSR75 does it right out of the box:

javax.microedition.pim.PIM.fromSerialFormat is specified as supporting vCard 3.0



来源:https://stackoverflow.com/questions/672704/where-to-find-a-java-library-to-read-vcard-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!