Android的contatcs电子名片API [英] Android contatcs vcard API

查看:142
本文介绍了Android的contatcs电子名片API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有Android的API来提取的vCard 3.0格式的联系人? 我所遇到的一个开放源代码的电子名片的项目 Android的电子名片

Is there any android API to extract contacts in vcard 3.0 format ? I have come across an open-source vcard project android-vcard

但在的用法示例以下意见被提及。

重要提示:如果您正在开发的应用程序的Andr​​oid设备,你不必再使用这个库,因为它已经包含在基本的Andr​​oid框架。这个库只有当你正在开发的应用程序是Android的环境外部运行非常有用。 Android开发者:读了这篇课文的两倍。

Important: If you are developing application for Android device, you don't have to use this library, because it is already included in the underlying Android framework. This library is useful only if you are developing application to be run outside of Android environment. Android developers: read this text twice.

能否请你让我知道哪个库中提到的上面的描述? 它是提供给应用开发者?

Can you please let me know which library is mentioned in the above description? Is it made available to the application developers?

推荐答案

这适用于巧克力慕斯蛋糕(> = Android 2.0的),我猜它有点此功能的示例页面描述

This works with Eclair (>= Android 2.0) and I guess its somewhat this functionality the examples page describes

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);
String vCard = new String(b);
sb.append(vCard);

这篇关于Android的contatcs电子名片API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆