Google

Get cross-site JSON via HTTP with GWT and the GWT Designer by Instantiations

Tagged:  

The GWT is a great development tool for designing Ajax applications. Since JSON is a great way to exchange data from the server to the client, in many cases, it is good to find a tutorial combining the two. Well, over at the Giant Flying Saucer blog they have put together a nice tutorial about cross-domain JSON and GWT. The tutorial is written for users of the GWT Designer, but even if you don't use that tool this tutorial has some good information.

Below is an excerpt from the tutorial.

If your a web developer then chances are pretty good you've already heard of and possibly used JSON. In a nutshell, JSON is a lightweight way to exchange data. In the second tutorial we did our communications to and from the server via RPC (Remote Procedure Calls). This time we'll modify the code to use JSON instead and call a third-party server (we will simulate this with a Python web server on the same computer).
Assuming you've got everything ready go ahead and open the project now. One of the first things the GWT JSON tutorial shows is how simple the JSON format is:

XML:

[
  {

    "symbol": "BA",
    "price": 87.86,
    "change": -0.41
  },
  {

    "symbol": "KO",
    "price": 62.79,
    "change": 0.49
  },
  {

    "symbol": "JNJ",
    "price": 67.64,
    "change": 0.05
  }
]

You can see JSON is just name/value pairs and human readable. Its simpler than XML and less verbose (less eyeball noise). Keep in mind though if you do need XML support that GWT offers that as well. Today though we are focusing purely on JSON.
So how do we actually get the JSON from the server to the client? Well, fortunately GWT provides everything we need in the form of the HTTP client classes. There are three items in particular we'll use from there:
1. RequestBuilder and calling the "sendRequest" method

2. RequestCallback which (remember the callback we had in the second tutorial?) will call "onResponseReceived" on a successful callback or "onError" if something goes wrong.
- Note: Toward the end of this tutorial we will replace the RequestBuilder code.

You can read the full tutorial here.

My Google Chrome Experience

Tagged:  

I've been using Google Chrome for the past few days and have been happily surprised by what I've seen. When you start Chrome you can hear that V8 engine rumbling and pages render extremely quickly. I've loaded many pages on IE7, Firefox 3 and Google Chrome on the same machine and it is incredible how much faster the page renders on Chrome than the other two browsers.

While I really like Firefox, it has some memory management issues that Chrome appears not to have. I've been surfing major sites and haven't had any issues rendering and interacting with pages correctly (while I am assuming that some JavaScript heavy sites may have issues). Like Firefox, Chrome comes with some decent developer tools, out of the box which put IE to shame.

With Chrome being from Google, I can see it having a better chance of competing with IE as Google has the money and resources to try and get more users to start "Chroming". It will be interesting to see what will happen once Chrome is out of beta and how it will compete with IE.

Even though Chrome is still in beta, I've started using it for the majority of my browsing and haven't had any issues (although I'm sure there are many that have found issues). So, if you haven't already, go download Chrome and enjoy a new web browsing experience.

Code Snippet: Detect Google Chrome w/JavaScript

With Chrome entering the browser market, you may find a need in the not too distant future to code some exceptions for it. In case that day comes, here's a quick snippet of JavaScript for detecting if your users are Chromed out:

You can detect Chrome using the following:
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

Chrome's full user agent:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13

Google Retracts Objectionable EULA Language

Tagged:  

In all the excitement surrounding the Chrome release, a few people quickly noticed some disturbing language in the EULA agreement:

11.1 You retain copyright and any other rights that you already hold in Content that you submit, post or display on or through the Services.

As Matt Cutts of Google blogged, Google has now retracted that language from Chrome's EULA agreement.

You are now free to post blogs (including this one) without consulting Google's legal team. *Whew*.

Google Chrome

Yesterday, the official Google blog broke the news that, yes, Google is indeed developing its own browser called Google Chrome. Much of the motivation and thinking behind this move is described interesting enough in an online comic strip.

Early news:

  • It is based on WebKit, the open source engine behind Safari
  • The browser runs with a JavaScript virtual machine codenamed "V8" that was developed from scratch by a team in Denmark
  • Each tab in the browser will represent a separate process, and will have its own controls and address bar
  • Google's Gears project will be bundled with the browser
  • The browser will have multiple tabs and an auto-complete address bar (like Firefox)
  • There will be a "privacy mode" where no traces of browsing history are left on the computer
  • Web applications can be launched in their own window (sans address bar, etc), an "RIA" feature
  • Built in protection from phishing and malware

According to the blog entry the beta version of Chrome should be available sometime today at this page, but as of this writing the URL just returns a "Page Not Found" (404).

Update: Chrome is now available at the above link.

GWT 1.5 Released

The Google Web Toolkit (GWT) project has released version 1.5 of its Java-based web development library yesterday. The new release sports a host of new features such as:

  • Support for Java 5 language features (generics, enums, enhanced for loops, and static imports)
  • Improved performance of compiled JavaScript code
  • It is now possible to sublcass the JavaScriptObject class, creating "class overlays" that can be mapped to arbitrary JavaScript classes
  • Expanded JRE emulation library
  • A new high-performance DOM API
  • Default visual themes: Standard, Chrome, and Dark
  • Support for right-to-left languages

For a full list of the new features, see here.

The new version can be downloaded here.

Introducing Content Licenses on Google Code

Tagged:  

If you host or get code from Google Code then this will be of interest to you. Google code now has the availability of content licenses. This will help promote the best practice of licensing open source code.

The Google Code team is pleased to announce the availability of content licenses for projects hosted on code.google.com. Projects owners may now select from either the Creative Commons Attribution license or the Creative Commons Attribution-Share Alike license to indicate the terms under which their non-source code materials may be distributed.

You can read more about this here.

Ext GWT 1.0 Released

The Ext JS team has released version 1.0 of its SDK for developing GWT applications with the Ext JS library. Despite some controversy around Ext's licensing strategy (namely the switch from LGPL to GPL), Ext GWT is currently one of the better integrations between a Java web application framework and a JavaScript framework.

Ext GWT 1.0 has been compiled and tested against GWT 1.5 RC1. Downloads are located here.

More real-time quotes on Google Finance

Tagged:  

Google has announced that they have added more real-time market data to Google Finance. This is great news for any user of Google Finance.

Below is an excerpt from the Google post announcing the change.

We're excited to let you know we're adding more real-time market data to Google Finance, Google.com and other Google properties. Starting today, you'll have access to real-time, last sale prices from the New York Stock Exchange (NYSE), along with those from NASDAQ, which we recently launched. Here's the NYSE press release.

What this means is that you can now get the latest real-time stock quotes on Google for free. Wondering what Ford (F) is trading at today? Search for it on Google or Google Finance and keep the page up to have the quotes stream live.

If you use iGoogle, add the Google Finance portfolio gadget to your homepage, and monitor all your NYSE and NASDAQ traded stocks in real time throughout the day.

You can read the full post here.

Google Finance is a very useful app to anybody following the stock market and anything that makes this app more useful is great.

goosh.org - The Unofficial Google Shell

Tagged:  

It's interesting that I just finished up a post on keypress navigation, because I've come across a little gem called goosh [goo-sh], an Ajax-based UNIX-like Google search shell that enables you to use the Google search engine with only your keyboard. Sporting a variety of commands listed in its help menu, goosh is just what you need to make your Googling just that much quicker.

Google itself has seen the value in adding keystroke navigation to their search engine as shown in one of the experimental search tools in Google Labs [demo].

Check your mouse at the door and visit goosh.org

Syndicate content