Creating Google gadgets with GWT - tutorial part 2

You should read part one before you continue here.


First lesson learned: you cannot get the HOST name of you gadget


String hostHost = Location.getHost().toLowerCase();
String hostName = Location.getHostName();





So I will be using URL parameters to set up my widget:


String gadget = Location.getParameter("gadget"); 








facebook4GWT API:


http://code.google.com/p/facebook4gwt/downloads/list












Creating Facebook gadgets in Google OpenSocial container does not work too well since you register the page on which Facebook app lives and in our case it is a Google server (e.g. 1.blogger.gmodules.com)





Facebook.init("7e52b37f9cc369XYZ1232");

Facebook.addLoginHandler(new FacebookLoginHandler()
{
    public void loginStatusChanged(FacebookLoginEvent event)
    {
if (event.isLoggedIn())
{
    facebookStatus.setText("Logged in");

    Facebook.APIClient().users_getLoggedInUser(new AsyncCallback()
    {
public void onSuccess(FacebookUser result)
{
    userName.setText(result.getName());
    userImage.setUrl(result.getPic());
    facebookStatus.setText(result.getStatus());


Solution for all this problems?

Use iFrame, I will investigate the best solutions in part 3 soon.




















As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles