如何导入Facebook联系人到我的应用程序基于Android平台?我的、人到、应用程序、平台

由网友(゛安于现状 ˉOrchゝ)分享简介:我开发VoIP应用中android.And我需要进口来自Facebook,微博,LinkedIn,谷歌(巴兹,Orkut的,联系人的Gmail)的姓名和电话号码的联系人etc.I正在寻找的API example.But我只能看到示例发布状态进入这些网站并没有对从Facebook导入联系人没有例子,orkut个人或Twi...

我开发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" );
    (...)
}

字段列表

阅读全文

相关推荐

最新文章