Sharing Gadgets
August 1st, 2006 | Published in Google Desktop
Some gadgets are simply better when you share them, and if you're thinking of creating such a gadget, you're in luck. By means of the Communication API, Google Desktop allows a gadget to exchange data with another instance of the same gadget on a friend's computer. Through Google Talk, you can send and receive short strings (up to 2 kilobytes) of anything you want -- text snippets, chess moves, whatever.
You start by setting a handler for incoming data. Then you can list the user's Google Talk friends and even determine if that friend is idle or busy. By knowing this, you can then send data to this friend and be certain that it will be received by your gadget. On top of that, you can ask Google Talk to open a conversation window with that same pal for those times when you just have to gossip.
There's already TicTacToe, a sample in the SDK that uses the Communication API. We've just added a new sample, TalkTester, which shows you how easy it is to use this seemingly limitless API.