intro on gwt & google apis (vikram rangnekar, coo of socialwok.com)

12
Introduction to Google Web Toolkit & Google APIs

Upload: singapore-google-technology-user-group

Post on 19-May-2015

1.873 views

Category:

Technology


3 download

DESCRIPTION

Talk 2: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com) http://www.linkedin.com/in/vikramr Description: Google Web Toolkit is a Java toolkit used for developing rich and standards compliant web-application interfaces. GWT requires you to develop your web interface in Java which is then compiled into optimized javascript. GWT makes your web GUI instantly work across the entire range of browsers (IE6, IE8, Webkit and Mozilla). We will understand rapid interface design / creation using GWT and how your applications can benefit from all the web-development best practices that Google has incorporated into the toolkit. Google API are all based on GData, there are a whole collection of API's that google made available. We will understand how to authenticate with google and go on to use a few of these API's.

TRANSCRIPT

Page 1: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

Introduction to Google Web Toolkit

&Google APIs

Page 2: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

What can I do with GWT

Page 3: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

What is GWT

• Write web-interfaces in Java • Seemless and flexible development model• Cross browser compatibility: IE6/7/8, FF, Chrome, Safari• Compiled and optimized standalone Javascript files• Gain from Googles years of domain expertise• Localization support

Page 4: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

GWT Hello World (HTML)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><script type="text/javascript" src="hw/hw.nocache.js"></script></head><body><iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe></body></html>

Page 5: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

GWT Hello World (Java)

package com.socialwok.samples;

import com.google.gwt.user.client.ui.Label;import com.google.gwt.user.client.ui.VerticalPanel;

public class HelloWorld implements EntryPoint {

private VerticalPanel mainPanel;private Label text1;

  public void onModuleLoad() {    mainPanel = new VerticalPanel();    text1 = new Label("Hello World");    mainPanel.add(text1);     RootPanel.get().add(mainPanel);  }

Page 6: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

GWT and Ajax

• Support for GTW-RPC, JSON and XML• GWT RPC is quite sophisticated, too. It can handle

polymorphic class hierarchies, object graph cycles, and you can even throw exceptions across the wire

•  Easily support the browser's back button and history

Page 7: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

Google AJAX API's

Searcho Can be used for image, news, web, social web and

other searches. • Visualization

o Used to graphically represent data. Google Finance and Google Analytics makes extensive use of it.

• Mapso Includes the static and dynamic maps.

• Languageo Detect and translate text and webpages.

• Many more http://code.google.com/apis/ajax/

Page 8: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

Google Data APIs

• Calendaro Create calendars, events, fetch agendas.

• Contactso Add or retrieve contacts.

• Docso Create and mange spreadsheets, docs and

presentations. • Gmail

o Create applications to easily upload photos from devices, desktop applications, and other web services

Page 9: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

Data API

•  Authentication - OAuth and Authsubo Recommend using OAuth (Popular web standard) o Both are based on callback  / request tokens

•  Libraries available in popular languageso Java, PHP, .NET, Javascript and Python

• Use the Atom (XML) syndication standardo Google's atom schema is called GData

• Each type of entry (docs, calendar, etc) has its own URL to retrieve and create.   

  Example: Default Calendar List URL http://www.google.com/calendar/feeds/default/owncalendars/full

Page 10: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

Javascript Data API

<head><script type="text/javascript" src="http://www.google.com/jsapi"></script></head><body> <script type="text/javascript">google.load("gdata", "1");google.setOnLoadCallback(logMeIn);

function logMeIn() {        scope = "http://www.google.com/calendar/feeds/";        var token = google.accounts.user.login(scope); }

Page 11: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

Create a Calendar Event

Using a raw atom message: <entry xmlns='http://www.w3.org/2005/Atom'

    xmlns:gCal='http://schemas.google.com/gCal/2005'>     <content type="html">Tennis with John April 11 3pm-3:30pm</content>     <gCal:quickadd value="true"/></entry>

Using the Java Calender API Library: CalendarEventEntry myEntry = new CalendarEventEntry();

myEntry.setContent(    new PlainTextConstruct("Tennis with John April 11 3pm-3:30pm"));myEntry.setQuickAdd(true);

// Send the request and receive the response:CalendarEventEntry insertedEntry = myService.insert(postUrl, myEntry);

 

 

Page 12: Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)

Q & A