Showing posts with label Technology. Show all posts
Showing posts with label Technology. 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, September 13, 2007

Google Map can't locate Mountain View (Google Headquarters)


Today I needed to go to Mountain View from my office in San Francisco downtown.
I called my friend, asked his address and typed following address in Google Map's driving direction section:

Start Address: 795 Folsom St San Francisco
End Address: 900 Highland Way, Mountain View, Ca 94041

Surprisingly, Google Map located end address of mountain view in somewhere in San Bernardino near Los Angles, around 400 mile away from its actual location.


Surprised with these results I tried same address with Yahoo Maps, Yahoo found Mountain View correctly but didn't gave me direction till Highland way. At end I tried same query with Ask.com and it told me that it could not find that street.

I called my friend again to confirm his address and found out I mis-heard the street name first time. After correcting the name every site it correctly.

I was most surprised with the google result, even though I had given the wrong street name, I had given everything else correctly even mountain view zip code. In the Google's result there were no indication that something is wrong with street name or address.




Till now I used to think that Google has done wonderful job with human language interpretation technology to understand users queries in its search technologies, but today's experience will force me to reconsider my decision.
What is ironic with this experiance is that Google has its headquarters in Mountain View, Ca

Sunday, September 2, 2007

BlackBerry for Sale

There are rumors that Microsoft and Research In Motion, makers of BlackBerry are talks for possible acquisition. RIM share touches all time high on last Friday.


If these talks end into success than it might be the largest acquisition in Microsoft history. On Friday RIM market cap crossed 47.5 Billion. If everything goes smooth than whole this acquisition may cost up 55 Billion to Microsoft.
This acquisition can give Microsoft great edge over competition, since BlackBerry has penetrated business user market across the globe. On the other hand Micrcosoft Windows Mobile is not that successful, although you can find them in some of Motorola Q and Plam Treo smartphones.

Another reason to believe in this rumor is that Microsoft is in immense pressure from Apple's iPhone and possible launch of Google phone. If Microsoft want to maintain its grip on mobile market this seems a logical move.

In the separate press release Microsoft and Research In Motion denied to comment on news saying its their general policy not to comment on speculation and rumors.

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

How to choose between blogging services, Wordpress, TypePad or Blogger

This weekend was evaluating some blogs for my own use.
In this evaluation I looked at following services
  • TypePad
  • Wordpress
  • Blogger
Considering features TypePad looks very impressive with lots of integration from third party to include content from Amazon, Skype, ProStores, Technorati and Pandora. TypePad is a paid blogging service starting at $4.95 per month, but basic version is limited in functionality like just allowing 1 blog for user. Since I am not planning to become a profession blogger and didn't expect any income from my posts. I am not interested to pay monthly fee when I can find similar service for free. So I dropped idea to create an account on TypePad.

Wordpress on the other hand is a free service and very very easy to use. It has wide verity of template to choose from and provide many good features which will be useful in long run. Like you can categorize your post which will be helpful for your readers as well as for you if you write on regular basis. You can also create sub categories which can come handful. Another nice feature for wordpress is that you can install it on your server if your server support PHP and mySql, but that would be useful only if you are advance user and keep all the data in your control. With own installation you can add and customize the solution specific to needs.

With all these features and easy of use it is a great site for users. I was very happy for the first hour. But as soon I tried to add some content from other site using javascript and html(specially iFrame, a technologies behind widgets revolution from Google, netvibes and lot other sites) it failed to display those. After goggling on this problem I found that wordpress stripes all javascript/html changes from your post, so you cann't include this widgets on your post until you install it on your server. Same issue came when I tried to integrate with feedburner. Even with these limitation it is great site for mainstream users and I strongly recommend it for anyone who doesn't have basic knowledge of programming or doesn't need advance features.

Since I am a software programmer by profession I was wanted to something more than just plain blogging( and obviously free of charge). So I continued my search and moved to next to next site in my list.

Blogger.com is another free site owned and operated by Google. It is also decent site, but not as user friendly as Wordpress. Blogger template collection also seems limited w.r.t wordpress. On the other hand blogger provides you option to edit html which is a big plus over competition specially if you know how to decode html. Blogger also have option to customize your different section to your post. e.g. you can add list of your favorite website or movies or books to it. Also it is pretty nice integration with other google services like adsense, feedburner etc. Also it doesn't block inclusion of different widgets on your page.

I finally decided to stick with Google. Mainly due to its greater integration flexibility, better customization and cost benefits.