If you’re a web developer and you haven’t explored the many ins and outs of Facebook app development so far, I would definitely recommend taking a weekend out just to try it out – you might be surprised at what you might learn (and it always looks good on a resume ;)). What I like about the Facebook platform is that you get a nice steady integrated flow of your friends comments, events, application notices and more made we want to ask the question – how can I build something cool that can use all this data? It’s actually surprisingly straightforward.

Facebook application development comes in five main flavors (some of which you can mix and mash)
Okay. So now we know what options are available to create our application, how do we decide which to go for?. It took me a few days to decide but in the end, as my app heavily relied on a PHP backend I opted to go for FBML + PHP my for my solution. It doesn’t really matter what flavor you choose as long as you feel comfortable with it. To begin go over to developers.facebook.com and sign up for an API Key. There are many great guides to setting up your first app and I would recommend this one.
Now that we’ve selected an implementation choice and have our API key, what else might we need to know before we can start coding?. Facebook and the developers community come with a variety of feature-rich solutions to access their services (most recently the Stream API). Know what resources and tools are out available to you before you begin. It could save you a lot of time.
Useful FBML Facebook components
When I started looking into the Facebook API I didn’t realize just how much I wanted to do was readily available. Here are some of the built-in components that you can use straight out of the box.

FQL – How to use it and why its important
FQL is the Facebook equivalent of mySQL and supports a similar syntax. It effectively allows you to query their web service and databases for information about a given user’s friends, photos and profile details and is a powerful gate to creating your own components which use this data. Whilst FQL is quite extensive, it doesn’t support the entire language-set you would expect with a full on querying language so work-arounds may be required for things such as the "LIKE" string. There’s a good list of FQL sample queries which you can find right here.
My tips on Facebook application development
When it comes to coding Facebook apps, my advice is simple: Think before you do :) That might sound obvious but I would genuinely encourage developers to write down what they would like their application to be capable of before they begin working on it – it helped me a lot. Once you’ve got a basic idea (or Wireframe) in mind, break your FB application down into components. Remember that the Facebook API is essentially a big shelf of information and you can pull anything you want out of it and stick it into a component to achieve something.
This means that if you like a particular jQuery slider, dynamic image grid or an autocomplete plugin – feel free to use it!. Speaking from experience and those of friends, you can find yourself frustrated with the Facebook API at times wondering how best to achieve something that would be trivial using plain HTML and javascript…in the end you’ll realize that there was an easier way to do it, so why not spend some time thinking about it now :)
There’s a whole world of amazing apps you can create with the Facebook API so good luck getting yours started!
Related posts:
Related posts brought to you by Yet Another Related Posts Plugin.
RSS feed for comments on this post. TrackBack URL
May 30th, 2009 at 12:14 pm
[...] See the original post: Anatomy of a Facebook Application [...]
May 30th, 2009 at 3:19 pm
You really should reference the Facebook Connect Plugin for Grails, which integrates all the Facebook stuff in a nice Grailsy way.
http://www.grails.org/Facebook+Connect+Plugin
( and why is your captch below the submit comment button ? ) :)
May 30th, 2009 at 3:53 pm
Cool. I really loved your article. What app did you create after you read about all this stuff?
May 30th, 2009 at 4:00 pm
[...] original here: Creating a Facebook Application – a simple guide for PHP … SHARETHIS.addEntry({ title: “Creating a Facebook Application – a simple guide for PHP …”, [...]
May 30th, 2009 at 4:16 pm
Thanks for asking! It’s not live yet but I created a PHP based image sharing service that allows you to customize images and serve them up to your friends as wall posts. It uses FBML for things like friend selection components and I found Dialog windows a very neat way of both presenting notifications and customization dialogs inside the app. One of the differences between my app and say..BumperStickers is that it goes the extra mile to preserve search functionality which is very important when it comes to large datasets.
You should definitely try your hand out at creating an app yourself!
June 3rd, 2009 at 3:41 am
??????????…
If you’re a web developer and you haven’t explored the many ins and outs of Facebook app development so far, I[...]…
June 5th, 2009 at 1:58 am
[...] Creating a Facebook Application – a simple guide for PHP, JavaScript, Flex and Grails develope… (tags: api facebook Tutorial) Posted by richesh Filed in Uncategorized No Comments » [...]
June 30th, 2009 at 6:57 pm
Sorry, but then is possible to integrate Jquery in FBML canvas? And how?
Just a <fb:ref or an include via php?
Regards