Archive for the ‘Android’ Category

Android 2.2 “Froyo”

Wednesday, May 26th, 2010

Android 2.2 was announced last week at the Google IO 2010 conference. The update is already available for the Nexus One through non official channels and is expected to come soon to other second generation devices. Froyo packs many little new features and improvements, but there are several that I think will make game development on Android so much better:

  • Developers can now declare whether their app should be installed on internal memory or an SD card. They can also let the system automatically determine the install location. This is huge, because up until now the apps could only be installed to the internal memory, which ranged between 128 and 512 MB for most Android phones (a far cry from the gigabytes available on the iPhone and iPod touch). Because of this problem, the majority of games for Android have been very light in terms of contents and graphics quality so far. Hopefully the SD support will change this; we will no longer have to resort to workarounds such as downloading game assets to the external memory during the first run to make “big” games on Android viable.
  • Dalvik JIT. A Just In Time compiler was added to the Dalvik VM. Google says it can improve performance of apps between 2x and 5x, though when it comes to games the the real speedups will be much more modest. On our Nexus One, The Android game we are working does not run at a higher FPS rate —already over 30 FPs most of the time anyway—, though load times are now noticeably faster and hiccups are much less frequent. I wished the JIT compiler made it into firt generation devices such as the G1, because those phones would benefit greatly from it.
  • Application error and crash reports. When an app freezes or stops responding, the user can choose to send a bug report to the developer with a click of a button, right from their phone. The new button appears in the application error dialog; if the user chooses to click it, a report is sent to Google which can be later checked by the developer on the Android Market. We have had this feature on the iPhone for a long time already, but the main difference (and advantage IMHO), is that collection of reports on the iPhone is done automatically whenever the users syncs with iTunes. On Android however, users must explicitely click on the report button, and I suspect many will not (specially users without data plans).
  • Better control over audio with new SoundPool methods. The Android audio API sucks for games, because it offers little control over caching and playback of sound effects and usually behaves very erraticaly. That’s the reason most Android games limit themselves to a few SFX, and never try to play too many at once. The new API methods now let us detect completion of sound-loading, for instance. So SoundPool sucks a bit less now.
  • Finally, I have realized that most of the native apps —such as the browser— now support both landscape orientations. Prior to 2.2, you were only allowed to use the landscape mode with the hardware buttons to the right. Still, the on-screen keyboard on our app compiled for 1.6 will refuse to work on the alternative landscape orientation, so it looks like only apps that target 2.2 and higher will be able to handle both landscape orientationsn properly.

Much better now, but still harder to produce high-quality games on Android than on iPhone IMHO.

The Google Wave notes of the “writing real-time games for Android redux” session is also worth reading for some interesting bits of information. Most notably, it seems that devices running Android 1.5 and 1.6 still take about two thirds of the market. This kind of negates many of the improvements that Froyo brings, since devs will need to target  Android 1.5 or 1.6 for a long time. Still, I can’t wait for the day when we will be able to target Android 2.2+ devices exclusively.