Showing posts with label HowTo. Show all posts
Showing posts with label HowTo. Show all posts

Wednesday, July 16, 2008

ABC of Facebook Application

Facebook offers a great platform and userbase for developing your cool app, but on the other hand their documentation is useless specially in Java side. I can' find words how badly it is written !*&@*&#*#.
When I development of my first Facebook app, I struggled a lot. I could find much more information in people's blog rather than on Facebook website.

I'll cover few of topic which will app development little simpler.

Facebook Session Demystified
Once user click on your application canvas link Facebook call your callback URL and pass this response to user browser. In this call authentication token is NOT added in the request your server receives. If you need authentication token you need to forward request to following URL


http://www.facebook.com/login.php?api_key=YOUR_API_KEY&v=1.0

Don't worry users will not be asked to login again. Facebook will create an authentication token, append it in your callback URL and send request to this URL.

Now you have authentication token. Store it in HttpSession; your will need it soon...
I a second we would try to fetch user friends list using FacebookRestClient class. I am using Facebook java apis hosted at http://code.google.com/p/facebook-java-api/
Use the stored authentication token to create instance of FacebookRestClient as

FacebookRestClient fClient = new FacebookRestClient(YOUR_API_KEY,YOUR_SECRET_KEY);
String fbSession = fClient._getSessionKey();
long fbUserId = fClient.auth_getUserId(token);

After this step most of the things are simple. Use various methods of FacebookRestClient to perform various actions e.g. getting User friend list.

List fList = fClient.friends_getAsList();

Store fbSession in HttpSession and use it in following request to get handle of FacebookRestClient in following way


FacebookRestClient fClient = new FacebookRestClient(YOUR_API_KEY,YOUR_SECRET_KEY,fbSession);


In next few post I'll try to cover more topics about Facebook Api including Feeds, notifications and more.

Thursday, March 13, 2008

Playing avi files from PS3 Hard Drive

I was trying to do it since long time.
I was able to stream avi to PS3 using Nero Media Server, but some time it use to give me troubles like skipping frames and jamming for some time.

Yesterday I tried to copy avi file to PS3(You have to copy it by using nero media server) and then play it from HD and surprisingly it worked. Actually PS3 dose support avi playback from hard drive but surprisingly Sony never revealed this feature.

I think you need to enable Divx playback in PS3 setting since it uses Divx codec to play avi. Also it will show avi clip as Divx under Video.

I would try to add video later today.

Saturday, September 1, 2007

How to use categories in Blogger

Word press has nice feature categorization, where you can associate your post to different categories for better management of your blogs. This help you as well as your readers for better navigation.
Blogger solves this problem in different way, it has borrowed concept of labeling from Gmail, where you can create different label and associate with your post. To use this feature set up your account as follows:
  1. Login to your account and go to Dashboard
  2. Click on Settings under manage.
  3. Click on Template-->Page Elements Tab.
  4. Add a page element in the section you want to show the categories.
  5. Navigates to Labels in popup page and add to page(You can customize display name for labels)
  6. Now whenever you create post give a label to it and list of all label will be shown on your post