Datasheet

Side-By-Side Comparisons with Android and iPhone
11
objects and event-handling mechanisms for applications and windows, as well as core system services
and media services enabled by the media layer and the core service layer. Developers will normally
use the functions and methods provided by the Cocoa Touch frameworks, although it’s also possible
to call directly into the media and core service layers for some fi ne-grained control of specifi c services.
Similarly, Android Java applications are built on top of the Android framework that consists of
an array of Java packages such as Activity Manager, View System, Windows Manager, Telephony
Manager, Content Provider, Notifi cation Manager, and so on. The UI is composed of a variety of
“view” components in a combination of layouts. The framework’s Java packages are the interface to
the underlying system capabilities, as they rely on corresponding native libraries to perform low-level
tasks. Developers can also inject native libraries into a Java application. Interaction between the Java
code and the native code occurs within JNI. Android introduces some distinct programming concepts
such as Activity and Intents, which makes it easier to extend system applications and services.
The WP7 application framework is .NET-based, and you can’t use native code (as discussed in the
“Limitations and Road Map” section of this chapter). Silverlight and XNA both provide a set of
.NET Framework types that serve as the interface to the underlying operating system. In addition,
applications can interact with media, local and remote data, sensors, location, and phone-speci c
information using the standard managed Windows Phone API. The .NET run time and libraries rely
on native system services and libraries. Each application is isolated within a .NET runtime sandbox.
The use of a sandbox means that cross-application communication isn’t allowed on WP7, which
means developers have to resort to web services as a bridge for cross-app communication.
Table 1-2 outlines application frameworks on the three platforms.
TABLE 1-2: Application Framework Comparisons
ITEM IOS ANDROID WP7
Available
application
frameworks
Cocoa Touch Android framework Silverlight and XNA
Programming
languages
Object-C Java .NET languages (C#
and Visual Basic.NET)
Native API access Yes Yes, via JNI using NDK No
SDK iOS SDK on Mac
OS X
Android SDK on Windows,
Linux and Mac OS X
Windows Phone SDK
on Windows 7
IDE Xcode Eclipse (with ADT plug-in) Visual Studio 2010 or
Visual Studio 2010
Express
UI defi nition NIB resource fi le Widgets and layouts XAML
UI event
mechanism
Delegates Event listeners in View
classes
Event handlers in CLR
(Common Language
Runtime)
C01.indd 11C01.indd 11 7/7/11 11:17:43 PM7/7/11 11:17:43 PM