Home > Google, OpenSocial, Software > OpenSocial – a simple application tutorial

OpenSocial – a simple application tutorial

March 12th, 2009


To pickup OpenSocial in the fastest manner, I chose to run its tutorial or sample application.

From there, I modified the code to learn some of the important or nice features of the OpenSocial platform.

That was exactly what I did when I came up with What Say U?.

That’s right, What Say U? application is actually an evolution from the OpenSocial “Giving Gifts” application.

You only need a few steps to run the tutorial application and on your way to make your own “personal” edition of the OpenSocial application.

1) Google Gadgets Editor

No installation required. Use your Google account and create your application code with Google Gadgets Editor.

The Gadgets Editor can be your IDE or if you have your own preference, you’d still need this as it’s very helpful for you to host your application code. 🙂

2) Use Tutorial Code

The tutorial page has 9 versions of xml file to show you step-by-step what you’d need to learn on the platform.

Follow through each step by copying the content of the xml to your own Google Gadgets Editor and save each of them with different filenames.

  1. Setting up the basics
  2. Listing friends
  3. Giving gifts
  4. Showing your generosity
  5. Showing gifts you’ve received
  6. Bragging about it
  7. Giving multiple gifts
  8. Getting a list of gifts from a remote server
  9. Taking advantage of views

3) Test in Orkut Sandbox

So now you’ve got the tutorial code ready and you might have browse through the xml code. How do you test it?

I recommend using Orkut’s OpenSocial container as from my test, it offers the latest platform version and it’s easier to test. It loads faster as compared to other social networks and it has a test environment : Orkut Sandbox

You might need to register an account if you do not have one yet.

At the left side bar, there is a column for Apps. Click on the edit link and you will be able to add your test application URL in this page.

Make sure you are at the sandbox ( http://sandbox.orkut.com ) or else you will not be able to see this function.

Add your application URL. At your Google Gadgets Editor, right click on the file name and copy the link location. That’s your application URL. Put it into your sandbox application and add it.

4) Trial and Error

Once your application is added successfully, you should be able to use it. Do note that you need to have some friends in your Orkut account as this tutorial application is to give and receive gifts with your friends.

So if you’re new in Orkut, try creating another account and then add both as friends. You should be able to see something like this:

Try make some changes to the code, upload your xml file to your Orkut sandbox and keep testing and trying until you got your application running as you want it to.

Unless you’re creating something really simple, you’re bound to face some issues if you’re not that familiar with the OpenSocial platform.

Try to get more information from the tutorials or specification guide and most of the time, you should be able to get your problem resolved. At least, that’s what I did. 🙂

Try it out.

It should just take you about 10 minutes or more to run the above.

Leave some comments if you have trouble running them here, I’d be glad to help.

 Follow me on twitter.





Google, OpenSocial, Software

, , ,

You might like the following posts too :

  • » Redis in Action by Josiah L. Carlson
  • » Redis Cookbook by Tiago Macedo, Fred Oliveira
  • » Developer Programs
  • » Running JUnit tests in Maven with Surefire Plugin and skipTests in default packaging
  • » Quick Guide to JUnit multiple parameter tests with Parameterized annotation