2010-12-02

Flash one of big selling points for Android

Just saw a commercial for a Videotron Nexus One (Videotron is a cell phone provider here in Montreal) and of the main points was the fact that it ran Flash. Love it. Well how else will I see ads, watch YouTube videos, view sport highlights on ESPN.com and TSN.ca and see news articles on CNN.com? Flash is a big part of the web experience.

2010-11-19

Flex, HTML/JS Pros and Cons from a developers point-of-view

Having worked these last couple of months on a pure HTML/JS project at work, I'd thought I'd share a few pros and cons and random notes of working in both Flex and HTML/JS programming languages.

I'm not here to bash one or the other, enough people do that, just some thoughts for you guys to draw your own conclusions. Also this is from a developer stand-point, building web applications, not a web site with simple text and images...but an app, where you load, create and update data.

Note: Was using jQuery 1.4.2 for the javascript portion.

Flex
Pros
  • AS3 is very similar to the Java programming language
  • Development, build and unit testing is almost exactly like in Java
  • Great IDE (Flash Builder) provides an easy and fast way to code in MXML/AS3
  • Online documentation is excellent and thus helps newbies learn the language
  • SDK is open source, so a developer can learn and extend the base classes himself if need be
  • In Flex, you manipulate the data directly and send it back to the server for processing, no need to worry about re-drawning the UI
  • No cross-browser, cross-OS issues
  • Object layout is flexible and easy to do
  • With its a default theme, the app can look good and professional
  • Can create re-usable controls/classes
Cons
  • Takes time for new developers to realize that the app is one entity that just sends data to/from the server and not a collection of pages
  • Compile times can be long
  • Developer can get into the bad habit of loading lots of static data (countries, provinces, etc..) up-front, that will never be used, thus causing an unnecessary long load time for the app
  • You application SWF can be de-compiled
  • If end user can to copy data from multiple controls (or from DataGrid) to paste into another app (say an email), you pretty much have to code this, where its a default functionality with an HTML page since 1975
  • Dealing with timezones can be a chore (Flex loves to deal with it on its own)

HTML/JS
Pros
  • Faster load times
  • The development cycle is quicker: update the page and reload in the browser
  • In some cases you can have a single page and use Ajax calls to get the data you need, no need for a page refresh
  • End users have been working with browsers for a long time now so the default copy'n'paste functionality is very useful to them and almost second nature
Cons
  • Cross-browser issues still exist!
  • IDE support not great for JS third-party frameworks like jQuery
  • In my case, no documentation existing for how to built a jQuery widget, had to find an online tutorial after searching. So no real API doc.
  • Object layout is a pain - tables still the way to go - and inconsistent across browsers sometimes
  • As a developer you need some design skills to make the app look good.
  • Handling the proper z-order of objects can be a chore
  • Reading someone's jQuery plugin/widget can be interesting (enough braces and commas for you?)
  • The browser BACK button can take your app out of proper state
A final thought...I like working in both technologies, I love to learn new things and working with jQuery has made working with data in JavaScript a heck of allot easier that it used to be 10 years ago. But I still look at it this way, if you want to build something people are going to read, you use HTML/CSS/JS. If you want to build an application, you use Flex.

2010-11-10

New Firefox 4 beta 7 is really fast

I just downloaded and installed the latest Firefox 4 beta 7 and man it is fast! The browser loads in an instant, not like beta 6 that took a minute to initialize and the pages come up in a flash! - couldn't avoid the pun :) There are also minor UI tweaks that are easy to notice.

You download it here.

2010-11-04

Great prez about the future of Flex (from MAX 2010)

Just saw Deepa Subramaniam's MAX 2010 presentation on the future of Flex and it is cool! If you are doing Flex development or are planning on doing so for the first time anytime soon, then I recommend you view her prez. She begins by talking about Hero, the latest Flex version currently being worked and then to talk about the future of Flex and the Flash platform and my favorite part was "Falcon"; the complete re-write of the Flex compiler. With "Falcon", we will be able to keep the "auto-compile" feature in Eclipse ON for good and not worry about slow downs while working on projects. But don't take my word for it...watch the prez for yourself!

So I guess Flash is popular afterall

With all the negative comments Flash has been getting in the last year, especially since the Steve Jobs essay back in April, it is nice to see that Skyfire, an iOS application built to convert Flash content to HTML5 has sold out 1 day after its initial release. Basically the Skyfire servers have been overloaded because too many users were viewing Flash content! Well time to get more servers eh?! :)

Skyfire sells for $2.99 on the app store.

2010-10-10

Built my first AIR app for iPhone

Well this past week I got my first ever smartphone, namely an Apple iPhone 4. It wasn't my first choice, I would have preferred a phone running Android, but my carrier had no such phones available...until this week of course (got to love how that works eh?).

Needless to say, after getting familiar with this iPhone, I wanted to see if I could build an app for it and after some research I found out there are several ways to do this:
  1. use XCode
  2. use HTML/JS/CSS
  3. use AS3/Flash
The first method described above is what is used in 98% of cases. You need a Mac and must have downloaded the XCode development environment and you can build an iPhone app (actually any iOS app...so it can run on iPhone/iPad/iPod) in the Objective C language.

Using the second method, you build a web application using traditional HTML/JS/CSS technologies and then compile them into a native iPhone app. There is a tool called Titanium Developer that I found that allows you to do this.

The third and final way to build an iPhone app is to use the Adobe Packager for iPhone. This little piece of technology if you remember caused a big stir back in April 2010 - cause Apple end-up changing its developer agreement and basically did not allow any third party tools, such as this one to compile any code for the iOS. Well I guess people complained and on Sept 9th, 2010, Apple changed their agreement once again, this time allowing such tools to be used. So basically I download it and build a very simple temperature conversion app (Fahrenheit to Celsius).

The Adobe Packager for iPhone allows you to take a SWF file an converted it to a native iPhone application. You can create your SWF file either by using the Flash CS5 authoring tool or by creating an AS3 project using the AIR 2.0.1 SDK in Flash Builder. In my case I built an AS3 project using Flash Builder and once the SWF was generated, I then used the iPhone packager to generate an IPA file. Then this IPA file is imported into iTunes so you can install (sync) the app onto the iPhone itself.

So its pretty cool to create your first iPhone app using AS3 and see it running. But there is a caveat. As I mentioned before, within Flash Builder you have to create an AS3 project to build the app. You can't create a regular Flex project that uses mx:Application or mx:WindowedApplication as its root class. You have to create a simple HelloWorld.as class that extends Sprite. So you can't use any of the regular controls such as mx:Label or mx:Button. Within an AS3 project you can only use the flash.text.TextField class and use that as a label, textbox and as a button where needed. So building an app in this way can be very time consuming to say the least.

Assuming that Apple doesn't change its stance once again, I'm pretty sure Adobe will be improve how we can build AIR apps for the iPhone in the very near future.

Important Note: In order to develop an app for the iPhone you first much purchase an iPhone Developer Certificate and this costs $99/year. Or you can jailbreak your iPhone :)

2010-08-31

Setting focus on a Flex app after its loaded

Every notice that after a Flex application is loaded by the browser that it doesn't have focus? So if your Flex application has a login screen, you actually have to grab the mouse and click somewhere on the Flex app for it to gain focus and for you to start typing. Well here is a quick and simple example of how to solve this problem on Firefox and IE. Doesn't work on Chrome and Safari...ah those bloody browsers again!