1

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 ..

thepoosh
  • 12,497
  • 15
  • 73
  • 132
Anas Hadedi
  • 103
  • 5
  • 12

1 Answers1

1

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!

Community
  • 1
  • 1
alex
  • 5,516
  • 2
  • 36
  • 60
  • what I want to fetch all images from album and store them in Array of Strings , Then I'll use that array in different ways as gridview or image pager ,, but now the problem for me how can I fetch them and store them on array of strings , – Anas Hadedi Jan 28 '13 at 16:12