Getting images from facebook album?

烂漫一生 提交于 2019-12-08 03:47:31
alex

you can fetch photos from Facebook via the Graph API. Taken from here https://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

Both results are json code, so you can map it e.g. with GSON

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.

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!

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