获取图片来自Facebook相册? [英] Getting images from facebook album?

查看:114
本文介绍了获取图片来自Facebook相册?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的图像查看器应用程序,我想让它简单,并从Facebook的图片albume绝招就是让Facebook的albume充当应用图像数据库所以,当我上传新的图片它在自动显示我的应用..

i'm creating images viewer app , I want to make it simple and get images from facebook albume "trick is to let facebook albume acts as a database of images for app" so when I upload new images it's automatically shown in my app ..

推荐答案

您可以通过图形API获取来自Facebook的照片。从这里取 http://stackoverflow.com/a/5841825/1965084 ,看看下面code:

you can fetch photos from Facebook via the Graph API. Taken from here http://stackoverflow.com/a/5841825/1965084 , have a look at the following code:

ImageView user_picture;
userpicture=(ImageView)findViewById(R.id.userpicture);
URL img_value = null;
img_value = new URL("http://graph.facebook.com/"+id+"/picture?type=large");
Bitmap mIcon1 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream());
userpicture.setImageBitmap(mIcon1);

我不知道,什么最好的方式来通知新上传的图片,但对于第一次从这里可以查看从时间元数据,以时间新条目:

I'm not sure, whats the best way to notify about new uploaded images, but for the first time you can check the meta data from time to time for new entries from here:

URL_TO_FACEBOOK + "me/albums" -> fetch albums
URL_TO_FACEBOOK + AlbumID + "/photos" -> to fetch photos of albums

这两种结果是JSON code,这样你就可以映射例如它与 GSON

UPDATE1:
首先看看Facebook的图形API 这里。尤其是这里您可以测试不同的方式通过图表来获取元数据。其基本原理是通过其用户ID(facebookname)和一个访问令牌(的此处描述)。然后你得到JSON输出作为回报,你可以映射到一个数组。要知道如何获取并映射JSON输出,你可以参考我刚才的问题这里

Update1: First have a look at the Facebook Graph API here. Especially here you can test different ways to fetch meta data via graph. The basic principle is to fetch all albums from a user via its userid (facebookname) and an access token (described here). Then you get JSON output in return, that you can map to an array. To know how to fetch and map the json output, you might refer to my earlier question here.

您的问题指的是一个复杂的过程,大约需要通过URL Facebook的图形API,JSON映射和加载图像的知识。看看这个具体的例子,它可能为你工作,但你要明白json的映射,使用Apache HTTP的客户端和图形API。

Your question refers to a complex process that requires knowledge about the facebook graph api, json mapping and loading images via url. Have a look at this specific example, it might work for you but you need to understand json mapping, the use of apache http client and the graph api.

希望,我的职位是对你有帮助,干杯!

Hope, my post was helpful for you, cheers!

这篇关于获取图片来自Facebook相册?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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