Skip to content

Lemon Digital Production

Lemon Blog

Wednesday, 24 June 2009

Please support fixoutlook.org

Outlook 2010 is in beta but Microsoft has not added support for Email Standards. Which means we'd be creating HTML emails using table layouts with non-semantic markup well into the future.

Microsoft has indicated they would listen to feedback. So please help the cause by joining the rally and tweeting your mis-givings (if any).

Remember to link to fixoutlook.org in your tweet.

Wednesday, 17 June 2009

Zend Framework and AMF

Zend Framework (ZF) has a handy component called Zend_Amf which provides a means for your PHP to communicate with Adobe's Action Message Format (AMF).

Serving AMF data from ZF is plain easy, it's also very simple to integrate into your existing website. As ZF is a component based framework you could simply pick out the Zend_Amf and related classes and use them. But obviously the integration is better if you have a full ZF stack.

For renault.tv we had setup an AMF API. Since we wanted to serve both HTML and AMF from the same backend we opted to setup the AMF server as a controller under ApiController.php:


class ApiController extends Zend_Controller_Action
{
public function preDispatch()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}

public function indexAction()
{
// instantiate server
$server = new Zend_Amf_Server();

// set production mode to true to suppress debug messages
$server->setProduction(false);

// handle request
$response = $server->handle();

echo($response);
}
}


We started with Matthew Weier O'Phinney's pastebin application which we found to be an excellent starting point for the structure of our boostrap and initialization code.

During development we quickly found the AMF response times to be slow, especially as the data size returned grew larger. The following .htaccess conditions helped improve performance drastically:


# Set some default PHP values
php_flag zlib.output_compression 1
php_value zlib.output_compression_level 2

# Gzip CSS, JS and AMF
AddOutputFilterByType DEFLATE text/css application/x-javascript application/x-amf


Here are a few best practices we picked up during development:

  1. All API functions receive an object pass back an object - this proved to be a very extensible approach and seemed to work well with Flash.
  2. Unit test all code. We setup unit tests for both PHP and Flash. As you may soon realise debugging AMF is very hazardous. To help easy the pain we use jQuery's qUnit test suite to mirror AMF calls issued from Flash. More on this in a future post.
  3. Use a HTTP Proxy to inspect your AMF output. Charles is highly recommended if you're on a Mac.
  4. Make sure no trailing spaces are left in your code output - editors tend to do this a lot. A good way to avoid this is to not close your PHP tags.
  5. We found associative arrays very problematic as the keys get lost in translation. So try to avoid them. Passing back objects is a good way to avoid this issue.


Go crazy!

Labels: , , ,

Tuesday, 16 June 2009

The Internet is Video

We all know online video is big. Despite the fact that there had been plenty of premature hype surrounding online video for years (remember Broadcast.com, anyone?), by the time Google acquired the wildly-popular YouTube for $1.65bn in 2006, it was pretty clear that the time was finally right for online video.

Since then, the market has only become more robust and competitive. BBC's iPlayer, which streams BBC programming to Britons over the net, started streaming high-definition video a couple of months ago. And Hulu has brought Americans high-definition television programming on the PC.

The message is clear: online video is here, it's getting better and it's going to play a prominent role in the future of the internet.

How big is online video today? In April 2009, Americans viewed 16.8 billion videos online. Over 6 billion of those were viewed on YouTube, which served 107.1m viewers.

These numbers are impressive but they only scratch the surface of what some believe the online video market will become. Cisco, the hardware giant whose wares support the backbone of the internet, is gearing up for a future in which the internet is essentially video.

It estimates that by 2013, global IP traffic will grow to 56 exabytes per month. Over the course of a year, that's two-thirds of a zettabye. Moreover, it expects that video will account for over 90% of the traffic.

The message for anybody with a presence on the internet is clear: if you want to succeed online, video is going to be a big part of what you do.

For businesses and brands that don't see how video fits into their plans and that can't imagine YouTube and streaming being of much use, the proliferation of online video means more than just 'video'. It means multimedia content and richer user experiences.

In this motion-centric internet, brands will need to think more about what opportunities they have to:

  • Produce visually-compelling content. We recently worked on RenaultTV. Renault is one of a growing number of brands that is thinking about how it can create and leverage content.
  • Create richer user experiences using technologies like Flash. Polaris, which manufactures various types of vehicles, makes great use of Flash on its website to engage visitors.

  • Multimedia content and experiences like Renault and Polaris are offering are going to become far more commonplace. The only question for brands that haven't jumped in is will they do so before their competitors.

    The iPhone: Now with More Developer Opportunities

    Apple's release of the iPhone 3G S was, not surprisingly, big news at WWDC 2009. While many believe that the iPhone 3G S is not a game-changer like the iPhone 3G was, the release of the iPhone 3G S and this week’s upcoming release of the iPhone 3.0 OS are important events for developers.

    Here's why.

    What’s New in the iPhone 3G S and iPhone 3.0 OS

    First, the insides of the iPhone 3G S are beefier. At the heart of the new iPhone is a CPU based on ARM's seventh generation Cortex-A8 core. There's also a PowerVR SGX graphics core and support for the Open GL ES 2.0 3D graphics API. And to boot, Apple has given the iPhone 3G S more RAM than its predecessor.

    What's this mean? The iPhone 3G S is much more powerful; Apple claims it can perform up to twice as fast as the iPhone 3G in a real-world setting. That in turn means that the iPhone 3G S is capable of delivering a much richer multimedia experience. Thus, it's no surprise that game makers, for instance, are sensing opportunity. The gaming category is already the top category in the App Store.

    Second, Apple has added some hardware niceties that have give developers more capabilities. There's a new camera, which offers 3MP of resolution and can capture VGA video at 30 frames per second. And there's an Accessories API that makes it possible to develop apps that interact with third-party hardware.

    Finally, the iPhone 3G S will come equipped with the 3.0 OS, which is set for release on Wednesday. The iPhone 3.0 OS will feature a number of updates of interest to app developers, including:

  • Mapkit - gives developers the ability to use Google Maps within their apps
  • Dynamic Map Markers - enables map markers in map-based apps to be updated in real-time.
  • In-application purchases - make it possible to purchase additional content and features from within an app itself
  • Push notifications - permit apps to receive notifications even when the app itself isn’t running

  • While it's possible to argue that all of these things are incremental improvements and some of the most requested features, such as the ability to run an app as a background process , aren’t (yet) being provided, Apple’s updates do offer a wealth of new opportunities for app developers.

    Improved performance will no doubt give developers the ability to do more with their apps. The iPhone 3G S upgrades will be especially useful to developers whose apps can benefit from third-party devices. And the iPhone 3.0 OS could boost the App Store economy. With in-application purchases, developers can create new revenue streams and with push notifications, developers can build apps that users interact with more frequently.

    Into the Wild

    Let’s take a look at how some of these things are going to be used in the real world.

    AirStrip OB
    AirStrip’s app makes use of the new push notification functionality to give medical practitioners the ability to monitor in real-time the vital health information of a patient. As data, which includes heart rate and blood pressure, is streamed from the patient, the practitioner can receive notifications based upon it.

    ZipCar
    US-based car sharing service ZipCar has built an app that not only lets users find ZipCar locations but also gives them the ability to reserve available cars at those locations and to unlock the cars they rent using the iPhone.

    PASCO Spark
    Science education company PASCO has developed an app called Spark which enables the iPhone Accessories API to connect to PASCO-built sensors. This enables students to measure and analyze data collected from the sensors directly on their iPhones.

    Star Defense
    Star Defense is an iPhone 3.0 OS gaming app that enables players to purchase new content/features directly from within the game using the iPhone 3.0 OS’s in-application purchasing functionality.

    Challenges
    The improvements seen in the iPhone 3G S and iPhone 3.0 OS come at a cost. As Engadget points out, for instance, the iPhone 3G only supports OpenGL ES 1.1 graphics API. It appears that developers will have a choice: they can build apps that support both OpenGL ES 1.1 and Open GL ES 2 or they can support only one. Apps that only support Open GL ES 2 will therefore be available only to iPhone 3G S owners.

    Obviously, the specter of a splintered app ecosystem could be problematic but as Engadget also notes, it’s somewhat expected given the rapid advances in hardware today.
    Regardless of compatibility considerations and the impact they have on the development process, the opportunities for iPhone developers are only growing in number and that’s a good thing that will drive further innovation.

    Friday, 12 June 2009

    Will you Bing?


    On May 30, Microsoft launched Bing - its latest effort to catch up to Google in the search engine wars.

    Previously, Microsoft’s search product was Live Search and the company had been all but written off as a search competitor. Its only obvious hope: acquiring Yahoo. But that was then and this is now. Bing is here and is definitely worth a look.

    Microsoft is branding Bing as a “decision engine” as opposed to a search engine and is investing $100m in an ad campaign to introduce consumers to its new product.

    Initial reactions to Bing from the media and blogosphere were positive. Some cooler stuff to take note of:

  • Bing automatically provides filters and links based on the nature of search results. If you search for a movie title, for instance, it knows to provide links to Images, Soundtrack, Cast, etc.

  • When a video is listed in the search results, Bing displays a thumbnail that, when rolled over, actually plays a preview of the video itself. Interestingly, Microsoft is using Flash instead of Silverlight to do this.

  • A history of recent searches (which can be cleared or turned off altogether) is kept handy on the left-hand navigation bar.

  • By rolling over the area just to the right of each search result, Bing displays a more detailed synopsis of the content on the page, including, where available, contact information and links.

  • Bing offers RSS feeds for any search. Just add the URL of your search to an RSS reader and viola!

  • Thanks to Microsoft’s ownership of Farecast, Bing Travel is already a pretty comprehensive travel search engine.

    While none of these features are going to be called revolutionary (and some of them were actually present with Microsoft’s old Live Search), it’s hard to argue that Microsoft hasn’t done a good job of “putting it all together”.

    Early indications are that this has been enough to spark interest. Last week, comScore reported that Microsoft’s share of search results pages increased 2% to 11.1% market share. And Microsoft has done enough with Bing to get the CEOs of Yahoo and Google to comment on it.

    Obviously it’s way too early to tell if Bing is going to help Microsoft compete with Google (and Yahoo) but while we wait to see how Bing does over the long haul, you might want to find out how well your website is Binging. Just in case.