Activate your free membership today | Log-in

Tuesday, May 6th, 2008

Ajax Pioneer Week: Bruce Johnson of GWT

Category: Google, Interview, Podcast, GWT

Today we have Bruce Johnson of the GWT team talking to us about GWT 1.5. He discusses the new features, such as the long awaited Java 5 language support, performance improvements, and much more.

It is very nice to take an application, run it through the new GWT 1.5 compiler, and get an instantly faster running application “for free”.


Previously on Ajax Pioneer Week…

Posted by Dion Almaer at 9:27 am
3 Comments

++++-
4.4 rating from 23 votes

Tuesday, April 22nd, 2008

Google offers Search, Feed, and Translation APIs to Non Ajax Usage

Category: JavaScript, Library, Google, JSON

The Google Ajax API team has been offering great services that you can use from JavaScript in the browser. I have talked about some of them on Ajaxian before (Feed API, Feed Discovery API, and the recent Language API) but now we have a great new release that enables you to access these APIs from Flash or the server side.

In fact, as long as your program can speak HTTP, you can have access to the services.

For example, you could now call this an REST API to Google Search.

To see it in action, point to something like http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Ajaxian and you will see the JSON output that is documented.

There are terms of use that you should abide by, and some other comments:

An area to pay special attention to relates to correctly identifying
yourself in your requests. Applications MUST always include a valid and accurate http referer header in their requests. In addition, we ask, but do not require, that each request contains a valid API Key. By providing a key, your application provides us with a secondary identification mechanism that is useful should we need to contact you in order to correct any problems.

Check out the updated documentation for more details on each API:

Including code snippets. For example, here is how you would access the search results in ActionScript:

JAVASCRIPT:
  1.  
  2. var service:HTTPService = new HTTPService();
  3. service.url = 'http://ajax.googleapis.com/ajax/services/search/web';
  4. service.request.v = '1.0';
  5. service.request.q = 'Paris Hilton';
  6. service.resultFormat = 'text';
  7. service.addEventListener(ResultEvent.RESULT, onServerResponse);
  8. service.send();
  9.  
  10. private function onServerResponse(event:ResultEvent):void {
  11.   try {
  12.     var json:Object = JSON.decode(event.result as String);
  13.     // now have some fun with the results...
  14.   } catch(ignored:Error) {
  15.   }
  16. }
  17.  

If you are interested in this kind of thing, as well as Gears, OpenSocial, AppEngine, or Android, check out the Google Developer Days coming to cities around the world or our big Google I/O event on May 28-29 in San Francisco.

Posted by Dion Almaer at 9:07 am
2 Comments

++++-
4.7 rating from 16 votes

Monday, April 14th, 2008

Appcelerator on App Engine

Category: JavaScript, Showcase, Google

I had a funny feeling that we would see frameworks and tools starting to support Google App Engine. Appcelerator has added support into their SDK, so you can now create an App Engine project.

They just ported Tejus’s appTunes demo to the App Engine and deployed it at http://apptunes.appspot.com.

The example uses embedded Flex components and sound.

If you take a look at the source, you will see the declarative markup that Appcelerator goes for:

HTML:
  1.  
  2. <body style="visibility:hidden" on="l:app.compiled then visible">
  3.     <div id="header">
  4.         <div class="logo" on="click then script[window.location.href='http://www.appcelerant.com/?p=54']"><h1 style="display: none">App Tunes</h1></div>
  5.         <div class="powered_by" on="click then script[window.location.href='http://www.appcelerator.org/']"><h4 style="display: none">Powered By Appcelerator</h4></div>
  6.     </div>
  7.     <div id="body" style="visibility: hidden" on="l:app.compiled then visible">
  8.  
  9.         <app :as_flexflow id="flow" on="r:get.albums.response then execute or r:select.album.response then select"
  10.                 property="covers" img_height="400" img_width="400" label_position="bottom" click_message="r:select.album.request">
  11.         </app>
  12.    
  13.         <app :graphical_music_player id="player" property="tracks" now_playing_message="l:now_playing"
  14.                 on="r:select.album.response then set_playlist and play or r:init.playlist.response then set_playlist">
  15.         </app>
  16.     </div>
  17.     <app :message name="r:init.playlist.request"></app>
  18.     <app :message name="r:get.albums.request"></app>
  19. </body>
  20.  

I expect to see other integration points for libaries, especially those that have server side back ends.

appTunes

Posted by Dion Almaer at 7:19 am
Comment here

++++-
4.1 rating from 22 votes

Tuesday, April 8th, 2008

What does Google App Engine mean for Ajax developers?

Category: Google, Cloud

I have been really looking forward to seeing the Google App Engine launch, and get in the hands of developers. This is just a preview release, and I obviously would like to see more languages and frameworks above and beyond Python and what we have now. The non-Pythonistas will all be saying "what about [insert my language and framework]". Slowly, slowly, catchy, monkey.

What is the Google App Engine?

Google App Engine lets you run your web applications on Google's infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users.

You can serve your app using a free domain name on the appspot.com domain, or use Google Apps to serve it from your own domain. You can share your application with the world, or limit access to members of your organization.

App Engine costs nothing to get started. Sign up for a free account, and you can develop and publish your application for the world to see, at no charge and with no obligation. A free account can use up to 500MB of persistent storage and enough CPU and bandwidth for about 5 million page views a month.

During the preview release of Google App Engine, only free accounts are available. In the near future, you will be able to purchase additional computing resources.

You have to understand the limitations, and the model that is being used. In my mind this is very different than other solutions like EC2/S3. There are very different use cases at work choosing between a low level (and hence very flexible!) provisioning system like EC2, and a deployment solution that gives you a sandbox to deploy applications. Google App Engine is a full stack.

The stack gives you access to Bigtable, which also means that you are not in the world of booting up MySQL. You do things "the Google way" and some people will like it, and some will not. That is fine!

What excites me about this, is that I often have a bunch of little applications that need a host. Sometimes it can be a pain to setup. Other times you would like to make the service public but don't want people to go hog wild and give you bandwidth costs and contention for your other apps on your host. Now I have a simple place to put these little apps, and this is where Ajax comes in.

As we develop richer applications with more client side logic, and natural service separations, we can create these modules as Google App Engine apps that do one thing well. There will be a natural fit for applications built with GWT, Flex, and other rich component toolkits.

Google App Engine doesn't give you something that you couldn't do in an Ajax application, but it does give you a place to throw up these services in short order. This is one step on the way to the world of DEPLOY. There are other services with different tradeoffs, such as Heroku.

I would love to see JavaScript on the server as an option, but that is back to language wars....


Posted by Dion Almaer at 8:55 am
7 Comments

++++-
4 rating from 21 votes

Friday, March 21st, 2008

Google AJAX Translation API

Category: JavaScript, Library, Google

Translation API

The game above uses the new Google AJAX Translation API that allows you to do two things via a simple JavaScript API.

Translation

If you want to take a word in one language, and translate it to another, you simply call something like this:

JAVASCRIPT:
  1.  
  2. google.language.translate('Gato', 'es', 'en', function(result) {
  3.   alert(result.translation);
  4. });
  5.  

Here are the languages we support.

What if you need to programatically grok which language a string is written in? You can use the detection algorythm:

JAVASCRIPT:
  1.  
  2. google.language.detect('Questa linea di rilevare che questa è la lingua.',
  3.  function(result) {
  4.   alert(result.language);
  5. });
  6.  

The detector doesn't just tell you the result, it also lets you know how reliable and confident it is.

Posted by Dion Almaer at 1:15 pm
14 Comments

++++-
4.3 rating from 29 votes

Wednesday, March 19th, 2008

Google Visualization joins the Ajax APIs

Category: JavaScript, .NET, Google

Yoah Bar-David & Itai Raz of Google have introduces the latest Ajax API: Google Visualization API, a new API designed for visualizing structured data.

There is a large visualization gallery that can show you some of the visualizations that you can use.

You tie into the API as you do with other Google Ajax APIs:

JAVASCRIPT:
  1.  
  2. google.load("visualization", "1");
  3.  
  4. var q = new google.visualization.Query(DATA_SOURCE_URL);
  5. q.setQuery("select A, sum(D) group by A");
  6. q.send(responseHandlerCallback);
  7.  

Take a look at this very cool example that the Gapminder team came up with (click on play)

This complements the Google Chart API, which just lifted its limits on the number of calls for charts.

NOTE: Google I/O is a conference being held at San Francisco on May 28-29 2008. APIs like this will be talked about. I will be there. And lots of good folks will be there (Steve Souders, Mark Lucovsky, Guido van Rossum, Jeff Dean, Chris DiBona, Josh Bloch).

Posted by Dion Almaer at 11:56 am
3 Comments

++++-
4.3 rating from 20 votes

Friday, March 14th, 2008

Lessons learned from improving Google Code web site performance

Category: Showcase, Google, Performance

We went through Google Code and did a lot of work to get it running faster.

The team used a lot of the principles from Steve Souders book: High Performance Web Sites and ended up with a nice gain:

According to our latency measurement stats, the user-perceived latency on Google Code dropped quite a bit, anywhere between 30% and 70% depending on the page. This is a huge return for relatively small investments we've made along the way, and we hope you'll find these techniques useful for your own web development as well.

The changes were low hanging fruit that most of the sites could also implement:

  • Combined and minimized JavaScript and CSS files used throughout the site
  • Implemented CSS sprites for frequently-used images
  • Implemented lazy loading of Google AJAX APIs loader module (google.load)

Posted by Dion Almaer at 3:58 pm
2 Comments

+++--
3.8 rating from 20 votes

Tuesday, March 4th, 2008

Google Gears for Mobile Released

Category: Google, Mobile, Gears

I have seen the huge batches of cell phones that companies keep around to test their applications on. Companies like UI Evolution have come along to try to help out the madness of getting something that works across more than a couple of them.

Not only do you have the problems of handsets, but you also have the network lock-downs and the hoops you have to go through to get an application onto a large set of devices.

Since the iPhone, I have strongly believed that history is going to repeat itself, and the Web is going to win on the mobile.

Enough rambling, Google has just released Google Gears for Mobile:

Today we're announcing the launch of Google Gears for mobile, a mobile browser extension for creating rich web applications for mobile devices. The first version is now available for Internet Explorer Mobile on Windows Mobile 5 and 6. It's a fully functional port of Google Gears v0.2 that can be used to develop offline capability into your mobile web applications. You can also create slick and responsive applications by hiding latency issues through controlled caching of data and storage of information between sessions. We're also working to bring Google Gears for mobile to Android and other mobile platforms with capable web browsers.

There are already a handful of Windows Mobile web apps that use Google Gears for mobile, such as the social payment service Buxfer and online applications provider Zoho.  Read more about these applications and how they use Google Gears for mobile on the Google mobile blog.

I got to fly back home to London to talk to members of the mobile team. Below is an interview with a couple of the engineers, and there is also a high level look at the news:


I am really excited about what this means for the future of mobile development. I want to be able to develop applications using Ajax on the phone, and see tools like Gears give me access to native APIs on those devices. I really hope that the iPhone SDK also offers more on the JavaScript API side too (as well as Cocoa). How nice would it be to take your iPhone app and finally get some onPinch goodness, and camera.takePhoto.

UPDATE: Wow, it is a mobile day, Nokia talks about plans for Silverlight

Posted by Dion Almaer at 9:37 am
1 Comment

++++-
4.4 rating from 9 votes

Wednesday, February 27th, 2008

gearsAJAXHelper: Using Gears as an optional speed boost

Category: JavaScript, Google, Gears, Performance

Ben Lisbakken, who sits 100 feet away from me, developed gearsAJAXHelper, a library that bridges the AJAX search and feed APIs with Gears, to get a speed improvement:

We decided it would be cool to write a small library to make it easy for you AJAX APIs developers to write quick-loading, always fresh searches/feeds. The gearsAJAXHelper has two main features - it allows you to store and return key/value pairs from the local database, and it allows you to choose whether you want all resources files on the page (images, CSS, Javascript, HTML) to automatically be cached in the Gears cache.

The key/value pair database feature let's you store the query/results as a key/value pair. Then, the next time the query is made, the results can be served from the database while fresh results are being retrieved. This dramatically reduces the latency in queries/feed grabs.

The (optional) automatic cacheing of resource files will make it so that each time the user visits your webpage they will be getting resources served from their Google Gears cache, not new versions from the internet. Be careful when using this feature, as you might not want stale content to be served. There is also a refresh function, to clear the Google Gears cache of old files.

You can take a look at the sample, that saves the content for presidential candidates so if you click back on an area, you get instant loads.

gearsAJAXHelper Example

The bulk of the API is:

JAVASCRIPT:
  1.  
  2. gearsAJAXHelper.initialize("election", "election", false);
  3. gearsAJAXHelper.storeKeyVal(key, value);
  4. gearsAJAXHelper.returnKeyVal(key);
  5. gearsAJAXHelper.refresh();
  6.  

This example shows how you can optional add super-caching to your applications with technology such as Gears. It 'aint just about offline!

NOTE: JavaScript Hackathon

If you are in the bay area, and like JavaScript (and if not, why are you on this blog!), then join us at Google this Friday for a Google Developer Hackathon focusing on JavaScript.

There will be two sessions -- one from 2:00PM - 5:30PM and another from 6:00PM - 10:00PM. You are welcome to stay for both. Please RSVP

Where: Google Campus: 1600 Amphitheatre Pkwy, Mountain View, CA 94043. It will be held in the Seville Tech Talk room.

Posted by Dion Almaer at 7:56 am
1 Comment

++++-
4.4 rating from 7 votes

Friday, February 22nd, 2008

Gears PubTools: Offline Enable Content in Minutes

Category: Google, Gears

Gears gives you all of the components that you need to take your application offline. If you have the type of application that for now wants to just take some of its content offline, that should be trivial to do right?

That was Brad Neuberg's position, so he created Gears PubTools as a way to make that happen. These tools are for content authors that don't even want to touch JavaScript.

How you use it?

Point to a Gears manifest file (a special file that lists all the pages to take offline) with a simple HTML attribute:

HTML:
  1.  
  2. <html gears-manifest="manifest.js">
  3.  

Create a desktop shortcut icon that points right to your app and
use a custom image:

HTML:
  1.  
  2. </html><html shortcut="true" gears-manifest="manifest.js">
  3.  <link rel="shortcut.icon" title="32x32" href="icon32x32.png"></link>
  4. ...
  5. </head></html>
  6.  

NOTE: This shows the Desktop Shortcut API that you can use in any offline application.

You don't even have to write the manifest file yourself! PubTools includes a simple bookmarklet that developers can drag to their browser's toolbar. Just navigate to the web pages you want offline, press the "Generate Manifest" bookmarklet, and a dialog will appear with the full manifest file generated for you ready to cut and paste into a file.

The core Google Gears gives us the building blocks that we can then build on top of to give users really easy tools and APIs. It has been great to see Brad join the Gears team and see him work on some of these issues. I expect to see much more from him in the future. What would you like to see?

Disclaimer: Remember, Brad and I work for Google

Posted by Dion Almaer at 11:56 am
1 Comment

++++-
4.3 rating from 15 votes

Wednesday, February 20th, 2008

Gears 0.2 is in the wild, in production

Category: Google, Gears

We have talked before about Google Gears 0.2. Now, it has been fully released and has been updated on users machines so you can rely on the APIs. The API changes include:

  • New modules: HttpRequest and Timer. The main reason for these modules was that developers told us they wanted to make HTTP requests and create timers inside Gears workers. But these modules can also be used outside of workers. For example, one advantage to using the Gears HttpRequest module instead of normal XMLHttpRequest is that Gears HttpRequest module addresses a common problem making comet-style applications work on IE.
  • Improved support for handling errors in workers. This is an area where we received a lot of good feedback. Now, errors from workers are automatically bubbled up to the main page by default so that you can see them in the error console or in Firebug. Or, you can handle them explicitly with the new onerror event.
  • Ability to load workers from a URL, even cross-domain URLs. We've long wanted the ability to load workers from a URL. We've also wanted to provide a way for different domains to communicate safely. This is useful in the case of mashups, or when an application spans multiple domains. The new createWorkerFromUrl API solves both these problems.

Now 0.2 is in production, the Gears team can look to 0.3 and items such as:

  • Added initial Desktop module.
  • Factory changes:
    • Added the hasPermission property.
    • Added the getPermission() method.
  • LocalServer changes:
    • Added the oncomplete, onerror, and
      onprogress events to the
      ManagedResourceStore class.

And hopefully some really interesting items such as those that I have been chatting about.

What would you like to see?

Posted by Dion Almaer at 8:13 am
Comment here

+++--
3.6 rating from 12 votes

Friday, February 1st, 2008

Google Social Graph API Released

Category: Google, JSON, Social Networks

Reposted from my blog

Would you like to be able to make a quick call to get a JSON response that ties together a social graph made up of resources available on the Web?

Social Graph API

Brad Fitzpatrick, Kevin Marks, and others at Google have released a new Social Graph API that does just that:

The new Social Graph API makes information about the public connections between people on the Web easily available and useful. You can make it easy for users to bring their existing social connections into a new website and as a result, users will spend less time rebuilding their social networks and more time giving your app the love it deserves.

Here's how it works: we crawl the Web to find publicly declared relationships between people's accounts, just like Google crawls the Web for links between pages. But instead of returning links to HTML documents, the API returns JSON data structures representing the social relationships we discovered from all the XFN and FOAF. When a user signs up for your app, you can use the API to remind them who they've said they're friends with on other sites and ask them if they want to be friends on your new site.

This is exciting to me as:

I gave it a quick test drive, and when I say quick, I mean 5 minutes :)

I built a tiny JavaScript library that takes a base URL, and it graphs out the relationships using Canvas.

You get to call loadGraph(URL, { width: w, height: h }) and the graph will be injected away.

It needs to be nicely abstracted and isolated so you can call it willy-nilly, but it works.

Watch the introduction video:


Posted by Dion Almaer at 2:13 pm
2 Comments

+++--
3.6 rating from 21 votes