Feb 14

We have heard that Flash is coming to the iPhone even since before the iPhone launched. Gear Live say that it is definitely coming.

Why isn’t it on the iPhone now? They make out that it is due to business decisions, but my guess is that this isn’t the case. The iPhone came out swinging that “the browsing experience is full.” The browser is a desktop-esque browser. No WAP here please.

This means that you would expect to see true Flash instead of Flash Lite, which you often see on a mobile phone. However, Flash does eat up a lot of memory, CPU, and thus battery, so I think that the Apple folks have been playing with Flash and making it fast and economical enough to run on the device.

At certain times it has been frustrating not to have Flash. You feel crippled. On the other hand, it has also often been nice. No silly Flash ads etc.

If it finally does make it on the phone, it will open up the world of iPhone development to Flash developers which will be a big thing.

Feb 06

Wayne Shea and Tenni Theurer have continued their performance series by delving into the iPhone and its poor little cache.

I always wonder why the cache is so small. It is typical Apple to not allow an expert mode where you can tweak it. I would rather have a few less songs and have a large cache. But, Steve knows best ;)

The end result of the article is that you should follow this ideal rule:

Reduce the size of each component to 25 Kbytes or less for optimal caching behavior

Given that the wireless network speed on iPhone is limited and the browser cache is cleared across power cycle, it is even more important to make fewer HTTP requests to achieve good performance than in the desktop world. To reduce the number of HTTP requests, Safari on iPhone supports image map, CSS sprites, inline images and inline CSS images. Take advantage of the browser cache whenever possible. If an external component can be shared across multiple pages in the site, remember that each individual component has to be smaller than 25 KB to be cacheable. Also, the maximum cache limit of all components is 475 - 500 KB. Minify all the JavaScript, CSS and HTML. For components that aren’t shared across multiple pages, consider making them inline.

This of course is quite painful if you like to package JavaScript in One Large File for other performance reasons, or if you use a library that is larger than 25KB!

The iPhone can tell us a bunch of things about a site. If I go to TechCrunch for example, it drives me batty as it does a bunch of JavaScript to load in the CrunchBase widgets, and the iPhone keeps thinking it is loading. The blue bar keeps going, and the browser isn’t as responsive. I hate those Crunchbase widgets :)

Jan 15

With the new WebClip feature, you can put Web pages on the iPhone / iPod Touch home screens. Instead of using favicons and morphing them in some way, you need to create a 57×57 PNG icon which gets automatically rounded and glassy, as mentioned on the http://apple.com/apple-touch-icon.png, and a set of “special” people seem to have built in icons.

Jan 14

The New York Times has a piece (login required): Google Sees Surge in iPhone Traffic.

It starts off talking about the title itself:

On Christmas, traffic to Google from iPhones surged, surpassing incoming traffic from any other type of mobile device, according to internal Google data made available to The New York Times. A few days later, iPhone traffic to Google fell below that of devices powered by the Nokia-backed Symbian operating system but remained higher than traffic from any other type of cellphone.

The data is striking because the iPhone, an Apple product, accounts for just 2 percent of smartphones worldwide, according to IDC, a market research firm. Phones powered by Symbian make up 63 percent of the worldwide smartphone market, while those powered by Microsoft’s Windows Mobile have 11 percent and those running the BlackBerry system have 10 percent.

But, then you get to the important piece from a developer perspective:

“Consumers are going to demand Internet browsers” as good as Apple’s, said Vic Gundotra, a Google vice president who oversees mobile products.

Mr. Gundotra said Web browsers as capable as the iPhone’s could also prove a boon for developers of mobile software, who have long struggled to adapt their programs to different types of phones. As it does on the PC, he said, the browser could provide a more homogeneous “layer” for programmers.

“The reason no one considered this seriously is that the Web layer on mobile devices was terrible,” he said. Google has taken advantage of the capabilities of the iPhone browser to create a product, internally called Grand Prix, that it says provides easy access to many of the company’s services, including search, Gmail, Reader and Picasa.

Google, which developed the first version of Grand Prix in six weeks, is introducing a new version on Monday, just six weeks after the first one. That is a speed of development not previously possible on mobile phones, he said.

2008. The year that developers swarm onto mobile phones through the Web floodgates.

Jan 02

Michael Mace has written about the war between Nokia and Apple, and how “When two elephants fight, the loser is the jungle.”

The winner is hopefully going to be us, the developers. When platforms fight, they tend to get more desperate and do things to spite the competition. They will all crave developers.

The Apple-Nokia war finally got underway on August 29, when Nokia announced an array of new music-capable phones and an online music store. The two companies had been eyeing one-another like wrestlers outside the ring for more than a year. Apple entered the mobile phone market, but only in the US, where Nokia is a non-factor. Nokia openly declared that it’s a computing company (link), but its non-phone products so far have been different flavors of lame.

But the August 29 announcements put Nokia and Apple on a path to direct confrontation. I haven’t seen a lot written online about the importance of this conflict. I think that’s probably because many of the people who follow Apple’s business closely are based in the US and have trouble taking Nokia seriously because it’s a secondary player here. Meanwhile, Nokia’s most ardent followers are in Europe, and look at Nokia’s actions in light of its regional conflicts with SonyEricsson and the European mobile operators.

But when you stand back and look at what’s happening in the industry worldwide, it’s clear that Apple and Nokia both want very badly to be the dominant mobile computing company for young adults. That makes a huge, relentless conflict between them inevitable. They’re like two armies trying to take the same hill. One’s coming from the west, the other from the east, so there’s not a lot of fighting at the moment. But as soon as they reach the hill, there’s going to be an explosion.

Michael goes into great depth on:

  • What Nokia announced, and why it matters
  • The new phones
  • Apples new products
  • Relative strengths of the competitors (Or, how to piss off both Apple fans and Nokia fans in the same post.)
  • How they’ll fight
  • A shift from hardware design to systems design
  • The operators lose control
  • What does it mean for users?

Only a brief mention of Microsoft, and no mention of Android.

Dec 27

I am always impressed, or down right amazed at what some of the developers are doing out there.

psx4iphone has been released:

The long-awaited Playstation emulator for iPhone has just gone public! Version 0.1 is now officially available via Installer.app and manual installation via the link below. Psx4iphone allows you to play Playstation (psx) ROMs on your iPhone. Ahh the memories. The zodttd forum also has a few threads that may be useful. This thread is home to a growing list ROMs known to be compatible with psx4iphone and a pretty comprehensive FAQ thread is maintained in this thread. The existing Gameboy and NES emulators for Apple’s first mobile handset are definitely fun but psx4iphone kicks it up a notch. Do you remember how annoying it was to come home to your NES after playing Playstation all afternoon at your buddy’s house?

Dec 25

iPhone Snow Globe

Apple has put up some sample code that shows off the new window.onorientationchange and window.orientation ability that lets you detect the orientation of the iPhone.

You setup your HTML with a body tag with the class of “portrait” or “landscape” and most of the CSS goes from that. You also put an empty div with the id of currentOrientation that is used for some of the magic.

Below is a simple JavaScript handler:

window.onorientationchange = function() {
  /*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode with the screen turned to the
    left, or landscape mode with the screen turned to the right. */
  var orientation = window.orientation;
  switch(orientation)
  {
 
    case 0:
        /* If in portrait mode, sets the body's class attribute to portrait. Consequently, all style definitions matching the body[class="portrait"] declaration
           in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
        document.body.setAttribute("class","portrait");
 
        /* Add a descriptive message on "Handling iPhone or iPod touch Orientation Events"  */
        document.getElementById("currentOrientation").innerHTML="Now in portrait orientation (Home button on the bottom).";
        break;  
 
    case 90:
        /* If in landscape mode with the screen turned to the left, sets the body's class attribute to landscapeLeft. In this case, all style definitions matching the
           body[class="landscapeLeft"] declaration in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
        document.body.setAttribute("class","landscapeLeft");
 
        document.getElementById("currentOrientation").innerHTML="Now in landscape orientation and turned to the left (Home button to the right).";
        break;
 
    case -90:  
        /* If in landscape mode with the screen turned to the right, sets the body's class attribute to landscapeRight. Here, all style definitions matching the 
           body[class="landscapeRight"] declaration in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
        document.body.setAttribute("class","landscapeRight");
 
        document.getElementById("currentOrientation").innerHTML="Now in landscape orientation and turned to the right (Home button to the left).";
        break;
  }
}

And, since it is Christmas/insert your winter holiday here, there is a nice sample snow globe that you can shake by changing the orientation of your iPhone.

Have a great holiday period, and try to stay off of your phones and spend some time with the family ;)

Dec 18

Joe Walnes is a great open source developer who works on mobile fun in the Google London office. He just released a new iPhone interface for Picasa:

I had a look around some websites and I really liked how they looked on the iPhone. I could get to everything I needed. I went to picasaweb.google.com but it didn’t quite feel right. It was using some very cool AJAXy features, but these were designed with a desktop web-browsing experience in mind. So the next day I had a go at creating a new interface for Picasa Web, designed for the iPhone.

Today, I’m happy to tell you that we’ve just released this new iPhone interface for Picasa. After you go to Picasa on your iPhone and log in, you can quickly see all your albums that you’ve uploaded to Picasa Web. If you click on any of the albums, you can get a full view of your picture with comments from your friends. Or you can click on Slideshow, sit back and watch the pictures scroll. You can also search for photos in your album or through community photos. Finally, with one of my favorite features, you can view your friends’ albums through favorites.

Picasa iPhone

Dec 07

Trawlr Ben has posted about his experience creating an iPhone optimised version of Trawlr with iUI and Rails 2.

He goes through the steps that he went through, which include:

  • Mime type: Mime::Type.register_alias “text/html”, :iphone
  • Detecting the iPhone: def iphone_user_agent?
  • Store whether it should be adjusted for iPhone adjust_format_for_iphone
  • Using iUI and creating iPhone views
  • Mr. TopFunky himself showed up to share his 80% solution for using layouts to generically support the iPhone without having to update views for each page:

    layout :determine_layout
    
    def determine_layout
      if mobile_safari_subdomain_or_relevant_header?
        return "iphone"
      end
    
      return "application"
    end
    
Dec 05

If you have gone to google.com on your iPhone recently you have seen a different interface. The iPhone specific site has been optimized for speed and fluidity. When we first got to see this work internally at Google we were all impressed at how Steve Kanefsky was able to make it seem so fast and smooth thanks to lots of caching and smart Ajax work. In fact, the searching itself uses APIs that you can use yourself, the Ajax Search APIs.

This interface is more than just search. Just as the Facebook application is so good due to the fact that Joe tried hard to think about what you would want to do on the phone interface (get info quickly versus browsing around FB endlessly), the same happens here. Core actions across Google are available. A quick look at your email, your calendar, your feeds, and much more.

Here is what Steve said about the project:

We all know that using the web on mobile phones can be a challenge sometimes. Compared to our personal computers, the screens are smaller, it’s more difficult to navigate and enter text, the network connections are slower, and the browsers lack many of the features we’ve become accustomed to. I deal with this every day as both a developer and a user of mobile web applications. So you can imagine how excited I was when the iPhone launched with a large touch screen, Wi-Fi, and a full-blown Safari web browser!

I started thinking about how to use AJAX technology to improve Google on the iPhone. I set out to create an application that would preload my favorite Google products and allow me to switch between them instantly. I wanted web results as well as image, local, and news results without having to repeat my search. I wanted to check Gmail and my news feeds in Google Reader without having to load a new page every time. I also wanted Google Suggest to save me time typing queries on the virtual keyboard.

I created a prototype and showed it to some fellow Googlers. After that, things started moving pretty quickly. A few weeks (and a few gallons of mint tea) later, I had an improved version which Googlers throughout the company were using on their iPhones (it works great on the iPod Touch too). Now we want to share it with everyone.

iPhone Google