如何导入Facebook联系人到我的应用程序基于Android平台? [英] How to import facebook contacts into my app built on android platform?

查看:128
本文介绍了如何导入Facebook联系人到我的应用程序基于Android平台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发VoIP应用中android.And我需要进口来自Facebook,微博,LinkedIn,谷歌(巴兹,Orkut的,联系人的Gmail)的姓名和电话号码的联系人etc.I正在寻找的API example.But我只能看到示例发布状态进入这些网站并没有对从Facebook导入联系人没有例子,orkut个人或Twitter等。是有任何的API与例如导入联系人?

I am developing voip application in android.And i need to import contacts with name and phone number from facebook, twitter, LinkedIn, Google(Buzz,Orkut,Contacts,Gmail) etc.I am searching for the api example.But i could see only examples for posting status into those site and there is no example for importing contacts from facebook,orkut or twitter etc,.Is there any api's for importing contacts with example?

推荐答案

您可以使用官方 Facebook的Andr​​oid的SDK 和认证后做这样的事情。

You can use the official facebook-android-sdk, and do something like this after being authenticated

Bundle parameters = new Bundle();
parameters.putString( "fields", "id,name" ); //see the link below to have the fields list

String response = facebook.request( "me/friends", parameters ); 

JSONObject json = Util.parseJson( response );

JSONArray data = json.getJSONArray( "data" );

for ( int i = 0, size = data.length(); i < size; i++ )
{
    JSONObject friend = data.getJSONObject( i );

    String id = friend.getString( "id" );
    String name = friend.getString( "name" );
    (...)
}

字段列表

这篇关于如何导入Facebook联系人到我的应用程序基于Android平台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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