Tuesday 4 August 2009

Give Your Robot a Profile Image

One of the first things I had to overcome was how to give my robot a name and a profile image. It gives a robot an identity so it is easily seen in your contacts list and as it participates in waves.

Although searching the API group gave some hint on what to do, it didn't show all the steps.

The robots I'm developing are using the Java API and I found the following the easiest method to add a profile image and name.

First of all you need to create a ProfileServlet. This extends the ProfileServlet class and is fairly well documented in the API.

Example code:

The final part (which is the part that held me up the most as I couldn't really find it mentioned anywhere) is to update the web.xml file to include the new servlet and to map the servlet.
The following code needs to be added to the web.xml file, replacing testbot.TestbotProfileServlet with your package name/ path to servlet.

After that, you can publish your robot to the appengine and it should now have a profile image and name. If your contact list doesn't update, you may wish to try removing and re-adding the robot as a contact.

Developing for Google Wave

In the last couple of weeks I've begun researching Google Wave and developing some simple robots for it.
One thing I've found is that there aren't many articles discussing developer related topics for Google Wave - especially when it comes to clarification of some of the API things, or elements which may not be fully documented.
The Google Groups are great, but slightly limited, so i'm hoping to use this blog to both ask some questions and also post things I find out which don't seem to be fully documented elsewhere.