Moving from 2011 to 2012, seriously!

By , 03 January 2012 00:27

I have done several new year posts (for 2008 and 2009) in the past. Reading them today once again made me remember the saying “be careful about predicting when future is involved”.

Both posts clearly show I was a keen believer of Rich Client Platforms especially Adobe’s Flex. The rise of iPhone which is followed by iPad and other mobile devices crippled the plugin based web platforms. Adobe who should already been working on mobile version on Flash, was never accepted on iOS but also failed to deliver a reliable Flash Plugin on other platforms. Finally this year Adobe discontinued mobile Flash in favor of focusing on Air.

The fall of the plugin based platforms let HTML5 get even more attention. Even Microsoft who still does not have a real HTML5 supported browser, killed Silverlight and announced HTML5 would be the main development platform for Windows 8 (aka Metro apps).

Despite all the trends there are still a lot of IE6 and 7 (also 8!) users which would make html5 hardly be used in real world projects. However many new web frameworks make use of available features and try to mimic the not supported ones. Still HTML5 might be too bleeding edge unless your project only aim to run on mobile since most of the mobile browsers do fully support most of the HTML5 features.

Android despite all patent issues, still on the rise. With the latest release of version 4.0, the ice cream sandwich, finally both phones and the tablets started running on the same operating system. However the version fragmentation became more visible. Even most of the phones still on sale are still based on version 2.2 or 2.3. Although many vendors announced upgrade plans, even most popular devices failed to updating 2.3. Besides the OS fragmentation, Android devices still lack nice designs and good build quality. Currently the only up to date device on the market is Galaxy Nexus and there are several nice designs such as Sony Experia Arc and Sensation XE/XL but still lacking updated os version.

Meanwhile Apple is still having their glory days. Although there were no major updates, iPhone 4s became a huge sales success. Everyone is waiting for the iPad3 which is rumored to have retina display. Although Apple is rumored to stop selling Mac Pros, Macbooks are getting popular than ever and if you ever had worked on one you would probably know why (if not, please try one! seriously).

Social media and apps are hot. Facebook and Twitter might have already taken the lead but apps like foursquare showed there might be room for more. So Google did not hesitate to jump in with Google+ which became the fastest growing network ever.

So here are some keywords for 2012:

  • Don’t count on plugin based platforms (Flash, Silverlight and even JavaFX). At least for the next few years the web will be HTML…
  • Learn Javascript! Although many frameworks might help you to generate js, still it is best to know the real thing.
  • Invest in mobile! Forget about JavaME (seriously), even if you are lazy to learn Objective-C, you can easily start coding on Android.
  • If you are an existing Flex/Actionscript developer, try out Flex for mobile! It is currently the easiest and most reliable way to build apps on both android and ios from one source.
  • If you are not then no need to spend time on Flex. Instead learn coding on native or html5. Take a look at PhoneGap and SenchaTouch.
  • NoSQL is hot. Give it a try!
  • JavaEE6 became even more lightweight and exciting with WebProfile which made using Spring obsolete. You can use either TomEE or Glassfish which boots up just as fast as plain Tomcat.
  • Invest in HTML5! Instead of starting from scratch try HTML5 Boilerplate and Bootstrap from Twitter.
  • If you are keen on HTML5 on real projects, take a look at Modernizr.
  • Unless you are a CSS master, try out {less} which might become a good HTML5 companion.
  • CoffeeScript is getting popular. Again unless you are a Javascript Ninja, it is worth to try.
  • Scala seems to be a good choice for next language to learn, well even Joshua Bloch says so…
  • If you are brave enough to stay on the bleeding edge Play! is a great alternative web framework which also has built in support for scala.
  • If you are looking for a solid, proven web framework while still able to HTML5 features, GWT would be a wise choice.
  • Dart is new but it is worth to follow. Even the Dart VM fails to be widely adopted it still has the option to cross compile to Javascript and the Google guys are experienced in doing that!
VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

GWT meets Flex: gwt4flex

By , 30 December 2011 23:04

2011 was definitely not the year of Flex. With the rise of the mobile devices including tablets, Adobe decided to step back instead of striking back.

Lately most of the web UI work I have been doing has moved to gwt from flex. I still feel flex is a great platform and enjoy coding in actionscript but have really doubts about its future.
While I go deeper in GWT, I found out a very interesting project by Alain Ekambi. I downloaded and gave a test drive. Honestly what I had in mind was different from Alain’s aim. I was expecting to find an easy integration of flex from gwt but what Alain had achieved was much more complex, building a Flex application (compiled swf) from gwt style code which is pure java.
I had been teaching and coding flex since version 2 beta, thus I feel very comfortable with actionscipt, mxml and event oriented programming. However not everyone feel that way and that was what Alain tried to achieve with gwt4flex which lets you to code in in GWT but compiles swf files offering a easier learning curve for Java developers.
I emailed Alain to see if I can achieve what I had in my mind, using flex components partially in GWT applications as if they were GWT components. Surprisingly Alain was kind and fast enough to implement what I wanted and sent me a beta jar in several hours.
GWT4Flex can be dowloaded on this link. The live demo shows a nice looking flex application, however, if you click the view source button what you will find out will be GWT style source code which does a client side pdf creation.
  1. public class Gwt4FlexExplorer extends  FlexEntryPoint {  
  2.    @Override  
  3.     public void onLoad() {  
  4.                 final Panel panel = Panel.newInstance(“Gwt4Flex and AlivePDF”);  
  5.                 panel.setPercentSize(70);  
  6.                 panel.setCenter(0);  
  7.                   
  8.                 final RichTextEditor richTextEditor = RichTextEditor.newInstance();  
  9.                 richTextEditor.setPercenSize(100);  
  10.                 panel.addElement(richTextEditor);  
  11.                 Application.get().addElement(panel);  
  12.   
  13.                 ControlBar controlBar = ControlBar.newInstance();  
  14.                 Button pdfButton = Button.newInstance(“Export text to PDF”“demo/pdf.png”);  
  15.                 pdfButton.addEventListener(MouseEvent.CLICK, new FlashEventListener<Event>() {  
  16.                     @Override  
  17.                     protected void onFlashEvent(Event event) {  
  18.                         if (richTextEditor.getText() == null || richTextEditor.getText().isEmpty()) {  
  19.                             Alert.show(“Please enter a text in the RichTextEditorControl”);  
  20.                         } else {  
  21.                             PDF pdf = PDF.newInstance();  
  22.                             pdf.addPage();  
  23.                             pdf.writeFlashHtmlText(richTextEditor.getHtmlText());  
  24.                             Application.get().saveFile( pdf.save(), “Generated.pdf”);  
  25.                         }  
  26.   
  27.                     }  
  28.                 });  
  29.                 pdfButton.setHeight(40);  
  30.                 controlBar.addElement(pdfButton);  
  31.   
  32.                 Spacer spacer = Spacer.newInstance();  
  33.                 spacer.setPercentWidth(100);  
  34.                 controlBar.addElement(spacer);  
  35.   
  36.                 Button sourceButton = Button.newInstance(“View Source”,“demo/code.png”);  
  37.                 sourceButton.addEventListener(MouseEvent.CLICK, new FlashEventListener<Event>() {  
  38.                     @Override  
  39.                     protected void onFlashEvent(Event event) {  
  40.                         FLEX.navigateToURL(SourceCodeController.getSourceFor(“RichTextEditor”));  
  41.                     }  
  42.                 });  
  43.                 controlBar.addElement(sourceButton);  
  44.                 panel.addElement(controlBar);  
  45.             }  
  46. }  
If you check Emitrom’s website actually they offer much more such as GWT4Touch which lets you code in GWT style Java and use Sencha Touch in the background!
Although I do encourage everyone to learn new languages, similar to Google’s approach of compiling javascript from well known Java, Emitron’s tools offer the most easy path for a Java developer to produce Flex or Sencha apps.
Great work Alain!
VN:F [1.9.13_1145]
Rating: 5.0/5 (2 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)