First small project with iPhone Flickr API and JSON

Posted by The Orange Herring on Feb 10, 2010 in Uncategorized |

As I said in my previous post, I worked on a small project to apply some of what I learned, the “Simple Flickr” application. What this application is doing is very simple: it allows me to browse my public pictures on the iPhone. I’m an amateur photograph and posted my pictures on Flickr some time ago to get other people’s reviews. I decided back then to organize my photos by sets which is a way to group photos on Flickr (flower set, landscape set,…). What this simple flickr application is doing is presenting all the sets with their main screen…
Main Window: Set List
… and give the ability for the user to click on a set and get the list of pictures within the selected set:
Sub Window: Photo List from Set
This project is obviously too simple to be a candidate for the App Store but it was good to apply what I learned. While doing it I realized that some concepts were not clear and I had to go back to the head first book and get help online to clarify things which is a good thing.
My code is very much based on the 3 parts tutorial mentioned in the prior post JSON/Flickr Tutorial. What is different is that it’s getting my pictures and not pictures from others based on keywords.
Code wise, the author of the tutorial created multiple arrays to store the picture names, small and medium photos (large one don’t fit in the iPhone). My approach was a bit different and I decided instead to create 1 single array of a dictionary which allowed me to have all the data in 1 single object.
The data and pictures are extracted dynamically using the Flickr API. I do a REST call to get data and ask for a json format back as it’s very easy in Objective-C to fit in NSArrays or NSDictionaries.
I’m using the flickr.photosets.getList API to get the list of sets and their picture:
@"http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=%@&user_id=%@&format=json&nojsoncallback=1"
I’m then using the flickr.photosets.getPhotos API to get the list of photos for a particular set:
@"http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=%@&photoset_id=%@&user_id=%@&format=json&nojsoncallback=1"

Tags: , , , , ,

1 Comment

  • rbfigueira says:

    Hi,

    Can you please share the code for learning ?
    I would love to see and get the source code.

    thanks

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Copyright © 2012 Learning iPhone Apps Programming All rights reserved.
Desk Mess Mirrored v1.4.5 theme from BuyNowShop.com.