Getting all my photos from Facebook using facebook-simple library

57 Views Asked by At

i have been trying for hours to figure it out what is going wrong and how i can achieve this. First let me introduce you one of the greatest library simple-facebook. Everything was working well (Login and logout), but when i have tried to use some other methods like getting all photos using class: OnPhotosListener, then everything got messed. First of all, some things there are working well, like getting size of photos, but not perfectly, it's getting only 25 photos from my facebook account, and there are a lot of more photos, so that would be first thing i would like to solve.

I guess that i need to load next page for solving that problem, but i'm not sure how i can do that. And second problem is loading all that photos. Methods for loading photos are

  • getPicture() which returns null

  • getSource() which returns also null

I should mention that many methods including above methods are returning null too like getName(), getPath(), getLink() etc.

Now i have found out that only one method here is working and that method is getId()which returns 50 ids of different photos. That is all what you need to know before showing you my code and what i have done so far. All in all i'm looking for alternative by showing photos using these ids i'm getting, or solving these null i'm getting. Here is my code:

OnPhotosListener onPhotosListener = new OnPhotosListener() {
    @Override
    public void onComplete(List<Photo> photos) {
        hideDialog();

        adapter = new TodayListAdapter(activity, topics);
        RecyclerView.LayoutManager manager = new LinearLayoutManager(activity);
        recyclerView.setLayoutManager(manager);
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.setAdapter(adapter);

        for (Photo photo : photos) {
            Topic topic = new Topic();

            Log.d("Picture ID: ", photo.getId());

            topic.setProfilePicture(photo.getPicture());
            topic.setPostImage(photo.getPicture());
            topic.setName("Nathan Taylor");
            topic.setCity("NY, NY");
            topic.setNumOfLikes(45);
            topics.add(topic);
            adapter.notifyDataSetChanged();
        }
        // prepareTestData();
    }
};
0

There are 0 best solutions below