Posts Tagged GWT

Slides from my presentation at confoo.ca

, , ,

No Comments

EricDaugherty.com: Does Write Once Run Anwhere Work?

Eric Daugherty:

Realistically, I think tools like GWT are the future. As a Flex developer, I enjoy the ability to quickly and easily create rich applications that will render the same on ever user's machine. But I would prefer that the Flex applications would compile to HTML and JavaScript, so they could be run native in the browser.

via EricDaugherty.com: Does Write Once Run Anwhere Work?.

, ,

No Comments

GWT and JavaScript Date hell

You’d think that in 2010, date processing is something that is easily done in Java (and hence GWT), in a consistent cross-platform way. And you’d be wrong.

When I’m talking date processing, I mean simple calendar date (not time) operations, like: get today’s date, add a number of days, compute the number of days between two dates, etc. The original sin, so to speak, is that Java doesn’t have a class to represent a day; Java’s Date class is actually more like a timestamp: it encapsulates a moment in time (with a millisecond precision) stored as the number of milliseconds to/from the moment called “epoch”, which is arbitrarily fixed at January 1, 1970, 00:00:00 GMT.

The methods related to date components (day of month, month, year, etc.) have all been deprecated since the apparition of the Calendar class (JDK 1.1). The trouble is, Calendar isn’t available in GWT’s JRE emulation library. So what do most programmers do? They use the deprecated methods of class Date. For example to create a Date that corresponds to a given day, they would use new Date(y, m, d). Well it’s deprecated, but it works, right?

Wrong. When instantiating a Date object using these deprecated methods, each JavaScript implementation tries to do its best to guess the correct timestamp, based on things such as the current time zone and whether Daylight Savings Time was effective at that time, and of course these rules vary by OS, JavaScript implementation and depend on the client’s regional settings. I’m not going into details now, but the bottom line is: you can’t expect to get a consistent behaviour.

Actually, if you might not notice this problem if all you do is manipulate local dates that were created on the client-side; the problem really becomes a nightmare when you mix locally instanciated dates with serialized dates from the server.

We’ve spent an incredible amount of energy and time to work around this issue, which is made worse by GXT’s DateWrapper and DateTextField. The awkward but kind-of working solution that we use now is to subtract Date.getTimezoneOffset() from Date.getTime() in order to “cancel out” the client’s time zone and DST. Not pretty.

If I had to do my current project again, I would definitely stay away from the Date type on the client side. As primitive as it may sound, if I have to manipulate dates without a time part, I would stick to using a (day, month, year) triplet and do as little date calculations on the client-side as possible.

You’ve been warned!

, ,

10 Comments

GWT sighting in Palm’s webOS Mojo SDK

While exploring the code samples that come with Palm’s SDK for webOS (named Mojo), I was pleasantly surprised to see that one of the samples (MojoMsgSample) uses GWT and the Google App Engine for the “cloud” part of the sample! It’s a basic publish/subscribe app, but still it’s nice to find oneself in known territory…

BTW, has anyone attempted to wrap the Mojo SDK in GWT? I’d be thrilled to be able to write webOS apps in GWT :)

, ,

No Comments

The future of mobile apps is web apps

This conclusion comes from examining the following facts:

  • modern smartphones are equipped with a recent, state-of-the-art, JavaScript/CSS capable web browser
  • modern smartphones are most often associated with a “always connected” data plan

What this means is that if you need to develop a mobile application that should run on several mobile platforms, you have basically two possibilities:

  • learn each different platform and associated SDK, develop and maintain a different version for each of them, not to mention you’ll have to manage distribution/deployment
  • write a single web app that will run on all platforms, and be always up-to-date

Easy choice isn’t it? Now I should also add a third fact that will undoubtedly contribute to this trend:

  • GWT and GAE make it ridiculously easy to build web apps (including for mobiles)

For example, my new Palm Pre doesn’t come with a facebook app. Why bother? it’s just a link to the mobile version of facebook.com. Maybe it’s not as rich as a native app, but it’s damn close, and the line will get thinner and thinner as HTML5 spreads.

Actually, the Palm Pre is a very good example of this convergence, since the standard SDK uses JavaScript as the development language. So basically, each app on the Pre is a web app!

You can read Alex Nicolaou’s blog post on the Google mobile blog for another view on this subject.

, ,

No Comments

It’s official: GWT 2.0.0 (with SpeedTracer)

Logo GWTFinally, as anticipated Google set the “release” tag on GWT 2.0 and announced it at its Campfire One event yesterday. In addition to the well-known major new features (development mode, Code splitting, UiBinder, ResourceBundle), Google comes with a new tool named Speedtracer to measure the performance of Ajax applications inside the browser. SpeedTracer is only available for Chrome at the moment, unfortunately only on platforms where extensions are supported, which means not on Mac currently (actually it does work on Macs, see comments to this post)

The online docs have been updated and are still IMHO a model of how online documentation for a project should be done: clear, concise, well structured, complete yet progressive, with examples… it’s almost fun to read. I wish every project had docs like this.

Download GWT, SpeedTracer or the Eclipse plugin

, ,

5 Comments

GWT 2.0 RC2 available

Logo GWTThe release is coming closer… Christmas gift anyone?

GWT 2.0 RC2 is available from this link. The Google plugin for Eclipse has been updated as well to 1.2 RC2

Caution Windows users who installed the IE plugin, you’ll have to uninstall it and install a new version (details there).

, ,

No Comments

The book is out… Le livre est sorti…

The same day as GWT 2.0 RC1, that has to be a good sign…

(cliquez sur le livre pour feuilleter une sélection de pages)

,

2 Comments

GWT 2.0 RC1 is out!

Logo GWTBruce Johnson:

Hi folks!
GWT 2.0 RC1 is now ready for you to try. The full documentation is still very much a work in progress, but you can at least start trying out the GWT SDK distribution and the Google Plugin for Eclipse using the following
instructions:
http://code.google.com/p/google-web-toolkit/wiki/GWT_2_0_RC
GWT 2.0 is going to be a big release, so don’t be surprised if there are a few bumps and surprises as we continue to finalize everything.

Read full announcement on GWT group


,

6 Comments

GWT is the present of web development

Logo GWTI’ve read a few articles by people who didn’t like GWT, but usually I don’t care to reply because it requires a lot of time to do it properly. However, today I came across this article on dzone: Lost in Translation or Why GWT Isn’t the Future of Web Development.

This one was troubling because it made good points on the way, some that I can’t agree more with (like the quality of Ext-GWT…) but it comes to a completely biased conclusion about GWT. So I took some time and wrote a reply

,

1 Comment