Pagine

sabato 3 luglio 2010

Google Gadgets Developer Guide

What are Gadgets?

Gadgets are simple HTML and JavaScript applications that can be embedded in webpages and other apps.

Simple to build

Built-in JavaScript libraries make it easy to create gadgets that include tabs, Flash content, persistent storage, dynamic resizing, and more. Use the Google Gadgets Editor to build gadgets quickly and easily.

Multiple sites

Your gadget can run on multiple sites and products including iGoogle, Google Maps, Orkut, or any webpage. Write your gadget once, and with minor changes it can run in multiple places.

Reach millions of users

Many gadgets are viewed millions of times per week and generate significant traffic for their authors. When users add your gadget to their iGoogle homepage for instance, they'll see your content each time they visit Google.


How do I start?

1. Check out our Getting Started doc.
2. Read the gadgets.* Developers Guide to learn more.
3. Test your gadget for common errors like XML, HTML, character sets, and more.
4. Submit your gadget to the directory.

More information

* Concepts and Examples - Read our design principles and examples for building better gadgets.
* OpenSocial - Make your gadgets social.

Resources

* Google Gadgets Editor - Host your gadget.
* Gadget Checker - Test your gadget for common errors.

Getting Started
http://code.google.com/intl/it-IT/apis/gadgets/docs/gs.html

Getting Started: gadgets.* API

Welcome to the gadgets API! To learn more about different types of gadgets and where they run, see the gadgets API Overview.

This developers guide is intended for people who want to use the gadgets API to write gadgets. Gadgets are so easy to create that they are a good starting point if you are just learning about web programming.
Contents

1. "Hello, World"
2. What's In a Gadget?
3. Where to Go From Here

"Hello, World"

The simplest gadget is just a few lines of code. This gadget displays the message "Hello, world!":





Hello, world!
]]>



Note the following about the "Hello World" example:

* Gadgets are specified in XML. The first line is the standard way to start an XML file. This must be the first line in the file.
* The tag indicates that this XML file contains a gadget.
* The tag contains information about the gadget such as its title, description, author, and other optional features.
* The line indicates that the gadget's content type is HTML.
* is used to enclose HTML when a gadget's content type is html. It tells the gadget parser that the text within the CDATA section should not be treated as XML. The CDATA section typically contains HTML and JavaScript.
*
signifies the end of the Content section.
*
signifies the end of the gadget definition.

What's In a Gadget?

The gadgets API consists of a few simple building blocks: XML, HTML, and JavaScript. To get started, all you need is a basic understanding of HTML. We will teach you all you need to know about XML to write gadgets. Later, as you write more sophisticated gadgets, you will probably want to learn some JavaScript if you're not familiar with it already.

XML is a general purpose markup language. It describes structured data in a way that both humans and computers can read and write.

XML is the language you use to write gadget specifications. A gadget is simply an XML file, placed somewhere on the internet where Google can find it. The XML file that specifies a gadget contains instructions on how to process and render the gadget. The XML file can contain all of the data and code for the gadget, or it can have references (URLs) for where to find the rest of the elements.

HTML is the markup language used to format pages on the internet. The static content of a gadget is typically written in HTML. HTML looks similar to XML, but it's used to format web documents rather than to describe structured data.

JavaScript is a scripting language you can use to add dynamic behavior to your gadgets.
Where to Go From Here

For general gadget programming information, go to Writing Your Own Gadgets. From there you can go to Development Fundamentals, or back to the documentation home page for an overview of sections and topics.

If you're interested in developing OpenSocial gadgets, here are a few places to start getting some hands-on experience:

* OpenSocial Tutorial for iGoogle
* iGoogle Sandbox Developers Guide, for information on developing gadgets for the iGoogle sandbox.
* Orkut Sandbox Developers Guide, for information on developing gadgets for the Orkut sandbox.


gadgets.* Developers Guide

gadgets.* API Developer's Guide

This is the developers guide for the gadgets.* API.
Sections Selected Topics
Getting Started "Hello, World"
What's in a Gadget?

Writing Your Own Gadgets Basic Steps
Anatomy of a Gadget
Development Fundamentals Choosing a Content Type
Turning an Existing Web Page or Application into a Gadget
Working with Userpref Data Types
Specifying a Geographical Location
Saving State
Writing Gadgets that Require Login or Cookies
Developer Tools Programming and Debugging Tips
Hosting through the Google Gadgets Editor
Hosting on Google Code
Creating a User Interface Managing Gadget Height
Setting a Gadget's Title
Tabs
MiniMessages
Flash
Working with Remote Content Working with Text
Working with XML
Working with Feeds
Working with JSON
Writing OAuth Gadgets
Internationalization Creating a Localized Gadget
Message Bundles
Using Message Bundles in a Gadget
Non-English Gadgets Where Can I Find Non-English Gadgets?
Writing Non-English Gadgets
Publishing Your Gadget Where Can I Put My Gadget?
Preparing for Publication
Publishing to the iGoogle Content Directory
XML Reference ModulePrefs Elements and Attributes
User Preferences
Content Section
JavaScript Reference JSDoc for the JavaScript API

Nessun commento:

Posta un commento