I have experience of developing commercially for the last years for iPhone and Android. I have only written "hello world" for webOS, so I will not mention it here.
Documentation
My experience is that the iPhone is the shining crown jewel, it plays in a league of it's own. The documentation and tools are pristine. Everything in the public API:s are well documented, and the example projects from Apple covers pretty much everything. The Cocoa Touch framework is well thought out and consistent; learn how one class works and you can intuitively know how the next works as well.
Whereas Android at version 1.6 still feels like an alpha where the API:s still needs sorting out. The documentation have many gaping holes, most constants never describe what they do, just what they are. The API is inconsistent and has not even figured out if it should be Object Oriented or not. Dialogs are the best example, where you define integer ID's and use several callbacks in a C-like fashion to display the dialog, but on the other hand have a factory class that is OO to an almost over engineered degree to actually create an alert dialog.
Programming Language
Cocoa Touch plays well with the Objective-C language and it's dynamic nature. Evident in basic paradigms such as delegation, and target-actions. And making cool frameworks such as Core Data tick.
The Android API:s are build on Java 5, but for performance reasons many Java 5 features are not used at all. Most evident is the complete lack of enums, and instead using non-type safe int constants, sometimes but not always with prefixes to help you with type safety.
Designing User Interfaces
The iPhone SDK features the Interface Builder, a GUI tool with WYSIWYG editing of user interfaces. IB (Interface Builder) is a kind of different beast than most GUI editors; it do not generate code, or even "recipe" files in XML or some other format. IB instead works with live objects that are serialized, or archived on Obj-C parlor. That are then unarchived as live objects at run-time. Takes some getting use to, but works great when understood.
On Android you define UI in XML files, that care "inflated" in Android parlor at runtime. This is a great idea and works really nice. Mostly because I personally hate the auto generated code blocks marked as "do not edit" (that you 11 times out of 10 have to edit anyway, breaking the tools). Constants to UI elements int he XML files are auto generated for you. On the downside the documentation for writing said XML files is almost non-existent, and there really shold be a prober drag-n-drop tool, not plain XML.
Performance Profiling
On the iPhone SDK you have a nice tool called Instruments, it is build on top of SUN's DTrace tool. Use it to profile any running application on simulator or on device. No changes to source code, just start Instruments and click the Record-button, for real-time profiling of: memory, CPU, leaks, GPU, ets. Then find your spikes on the visual graphs and display actual stack-traces for the bottle necks, double click to show your source code inline with overlays for percentage of CPU spend on each source line for example.
On android you can add the statement Debug.startMethodTracing(String filename)
, in your source code. And then use the traceview
tool to inspect the result, after pulling the file out of the emulator or device. It works, but is not quite as nice.
Persisting Data
On iPhone OS you have a very nice framework called Core Data, it is an ORM on top of SQLite databases. You have a visual graph tool for designing your entities with attributes and relations. As well as visually designing version upgrades. All SQL is hidden away. By default all entities are handled as instances of NSManagedObject
and values are fetched like if from maps, if you like you can implement your own subclasses of NSManagedObject
with extra logic, assign them in the visual tools and Core Data will instantiate your classes instead where approperiate.
Android also uses SQLite and have a really cool feature called Data Providers, where data can be shared between applications. Data is requested by URI and returned as traversable cursors. From client side this concept is very flexible, brilliant actually. On server side not quite as nice, as you will have to implement most of the mapping from URI down to SQL yourself. Often in two layers, from from an URI-mapper to actual requests, and then down to SQLiteDatabase
queries, that are SQL but not quite.
Open GL
On the iPhone you have OpenGL ES 1.1, or 2.0 for iPhone 3GS and latest iPod Touch generation. Since Objective-C is a strict superset of C, you simply use the official OpenGL ES headers. A cool note is that all UI is hardware accelerated using OpenGL on iPhone. All UI elements are backed by instances of CGLayer
that is an abstraction of a OpenGL polygon. This means that UI composition, translation, scaling and all other transformations are done on the GPU. On the downside no UI component can be more than 1024x1024 pixels, if you want more you must do tiling.
On Android you have OpenGL ES 1.1 with Java-bindings - JSR-239. It works as expected, ut requires use on byte, and int buffers for transferring actual data from the Java run-time to the native OpenGL ES implementation. The "normal" UI is software rendered, so if you want GPU acceleration then you must use OpenGL explicitly.
User Interaction
The iPhone is touch only - period, no hardware buttons that 3rd party applications can take advantage of. On the upside the touch API:s are all designed for multitouch. Currently the platform supports up to 5 simultaneous touch points, the API do not expose this platform limitation. The APIs also exposes support for rudimentary gestures such as swipes and shakes.
An android you have many more input methods; hardware buttons, full qwerty-keyboards, track-balls, and not the least touch. The touch API as on Android 1.6 is bound to 1 touch point, so multi-touch can not be realized without introducing new APIs. This is a major drawback for games, making it impossible to implement a play-scheme where you can shoot at the same time as walking on touch-based inputs, very important now that devices without physical buttons are coming to market.