Archives for January 2010

Apple, Flash the iPad and premature speculation

With Apple's announcement of the iPad and the subsequent storm about it not supporting Flash a lot has been written about Flash's demise. People are pointing to Apple's decision to not provide Flash support in the iPad and iPhone as a sure indicator that Flash's days must surely be numbered. As a freelance Flex developer, Flash (Flex) is my bread and butter, it literally puts food on my table so I have a vested interest in what happens with Flash and it's continued use and adoption on the next generation of internet devices. 

The release of the iPad seems to have polarized developers into one of two camps, traditional HTML/Javascript/open source purist developers who say Flash is going down for the count and the Flash development community and it's supporters who are screaming bloody murder at Apple, running around like the sky is falling since the iPad doesn't support Flash. I think both sides are missing something, the elephant in the room that a few days of reflection has made very clear in my mind. 

Everyone seems to be solely focused on video and the fact that HTML 5 can do video and that's why Apple doesn't need to include Flash on the iPad. True, HTML 5 can do video and video is a part of what Flash does quite well, but that is like comparing newspaper to television. Sure they both provide information, they tell stories, communicate points of view and provide entertainment, but no one would argue that newspapers are going to replace televisions (or vice versa), yet I think that's what is happening with the current debate that Apple's decision seems to have reignited. 

HTML is great at what it does. Flash is great at what is does. However I think that a developer who understands both, their strengths and their weaknesses, would not argue that HTML5/javascript will replace Flash. HTML is a great general, blunt force tool for presenting information over the internet. Flash is a more specialized tool, that when used properly, can augment HTML to better present information. Much of the backlash against Flash is from people who have experienced it when developers tried to use Flash for purposes it likely really should not have been used for.

The Flash community seems to have forgotten the above statements to some extent and the HTML purists seem to be oblivious to many of the things that are simply not possible in a browser without the Flash (or something other ie Java) plugin.

This is a short list of things Flash can do that HTML/Javascript can't:

  • cross platform support for video
  • cross platform support for audio
  • video camera capture
  • microphone capture
  • read/write access to the local file system
  • sockets (ie xml socket connection)
  • bitmap manipulation
  • graphics/3D rendering and animation
  • speed of xml parsing and searching (e4x)
 
Am I concerned that the Apple hasn't enabled Flash on the iPhone and iPad? Yes.  As a web developer I would like the content and applications I produce to be available to people on those platforms.
 
Am I freaking out thinking that the sky is failing because there is no Flash on the iPad? No. There are so many things Flash can do that people need done on the internet that can not be done in other environments that Flash is not going the way of the dodo bird anytime soon. Having said that I will start learning more about using HTML5 and javascript but any good developer should always be learning new tricks, it's called survival of the fittest.
 

 

PHP SimpleXml Parser Error

If you use PHP with SimpleXml to parse xml you may run across a strange issue where SimpleXml fails to parse perfectly formatted xml. You'll likley get an error like this

Warning: simplexml_load_string() [function.simplexml-load-string]:

Entity: line 1: parser error : AttValue: " or ' expected

Chances are the PHP server has 'magic quotes' turned on. To get around the issue, add a strip slashes command to the xml string before parsing it. So your php would change from

 

$xml = simplexml_load_string($xmlstr); 

 to

$xml = simplexml_load_string(stripslashes($page));

 Hope that helps someone, frustrating bug to track down.