Developer's overview and comparison of the iPhone and the ...
Upcoming SlideShare
Loading in...5
×
 

Developer's overview and comparison of the iPhone and the ...

on

  • 2,068 views

 

Statistics

Views

Total Views
2,068
Views on SlideShare
2,062
Embed Views
6

Actions

Likes
0
Downloads
50
Comments
0

1 Embed 6

http://www.slideshare.net 6

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Developer's overview and comparison of the iPhone and the ... Developer's overview and comparison of the iPhone and the ... Presentation Transcript

  • iPhone Developer’s overview and comparison of the iPhone and the Android platforms Erlend Stav SINTEF ICT June 2009 mailto:erlend.stav@sintef.no ICT 1
  • Overview iPhone Vendors and licensing Application distribution Platform architecture Application architecture GUI and other components Inter-app communication Development tools ICT 2
  • Devices, licensing , and openness iPhone Apple is the only device vendor Open Handset Alliance Device OS is not open source Devices from multiple vendors, including HTC, Samsung, Sony iPhone Developer Program Ericsson, Motorola, Acer, … membership has an annual fee Free and open source mobile ($99 to $299) platform, including OS, Regular iPhone and iPod Touch middleware and key retail devices are used for applications development, but each device Regular retail devices can be must first be registered by the used to test and use developer under the iPhone applications Developer Programme Android Dev Phone 1, SIM- unlocked and hardware- unlocked development device, but is currently only ship to 18 countries worldwide. ICT 3
  • Distributing your applications iPhone iPhone Developer Programme Developers can publish their members can sell or provide applications through Android their applications for free Market through App Store To become a publisher of applications in the Android Market Applications have to be requires registration and a fee approved by Apple before the ($25) become available in App Store Currently only developers from 7 With the Store Kit API countries can sell applications developers can integrate Currently free applications can be purchase of new content and distributed to 24 countries, and paid application extensions into their applications to 9 countries applications In-house distribution available for enterprises with 500+ employees ICT 4
  • Acquiring and deploying applications iPhone Applications are acquired by Applications can be acquired by users through Apple’s official users through Android Market App Store (both free and paid) Applications are acquired Applications are acquired directly from Android Market to directly from AppStore to the the device. Currently Market is device, or using AppStore from not viewable outside the device. iTunes on PC / Mac and then All code for an application is synchronizing the device bundled as an Android package Updates to installed for distribution and deployment applications are visible when Updates to installed visiting AppStore or using applications are available when iTunes, and selected updates visiting My Downloads under are deployed similar to new Android Market. applications ICT 5
  • iPhone Architecture Overview •UI Kit •In App Email Cocoa •Map Kit Framework •Address Book UI Touch •Apple Push Notification Service •2D Graphics (incl. PDF) •Audio Media •Animation •OpenAL •OpenGL ES (2D & 3D) •Media Player Framework •Foundation •Core Location Core •SQLite and XML support •Address Book Services •Core Data •In App Purchase •CFNetwork •System Core •Accessory support •Security OS ICT
  • Architecture overview Source: http://developer.android.com/guide/basics/what-is-android.html ICT
  • Runtime model / processes for application iPhone Single 3rd party application Full multitasking running Default: every application has Design rule: fast launch and fast separate Linux process shutdown, store state to allow Each process has its own Java users to continue where they VM left To conserve resources it is Application launch image – possible to allow applications to gives user impression of quick run in the same process, launch sharing the same VM This Apple video includes an These YouTube videos shows example of the basic interaction how home screen and home (time interval 1:12-1:22) button is used to switch between applications ICT 8
  • Application Architecture No main() function for Activity: presents user interface applications Service: Four kinds of components, runs in background without an application may have user interface multiple of each. Broadcast receivers: only receives and reacts to broadcast announcements Content providers: makes set of application data available to other applications ICT 9
  • Activities, tasks, intents A task is a group of Activities, services and activities arranged as a broadcast receivers are stack (seen from the user activated through as an application) asynchronous messages One activity can start called intents other activities An intent names an action Activities from different and a data URI applications can part of Intents supported by the same task (but belong components are declared to different processes) in the application's manifest See this YouTube video for illustration ICT 10
  • Lifecycle of activities Source: http://developer.android.com/guide/topics/fundamentals.html ICT 11
  • User interfaces Views are basic units of UI, view groups View groups, such as layouts, provide hierarchy and organization such as linear, tabular, etc. Rich set of widgets (concrete views such as buttons, text view, image view, etc) Activities have a content view Source: http://developer.android.com/guide/topics/ui/declaring-layout.html ICT 12
  • iPhone Application architecture Applications have a main() Core data function (usually follows a Manages changes to model template) objects Allows keeping just a subset of model objects in memory Design patterns Schema describe model Model-View-Controller objects Delegation Trigger-action ICT 13
  • iPhone Application lifecycle Source: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/index.html ICT 14
  • iPhone GUI Rich set of views designed for touch interface Multi-touch events View animation Source: http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/index.html ICT 15
  • iPhone Tab Bar GUI and controllers Source: http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/index.html ICT 16
  • iPhone Navigation GUI Source: http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/index.html ICT 17
  • High level components iPhone Map component (based on Map View (as add-on), supports Google Maps), can add overlays annotations Web View HTML-viewer (including HTML, Video View CSS and JavaScript content) Media Controller Contact / mail Music In addition activities from other Photo library applications are integrated Camera – standard UI for taking through intents pictures ICT 18
  • Inter-application communication iPhone Launch other application using Launch other activities using an URL to communicate with it intents with action and URI Application can register custom Components register intent URL schemes filters they react to Copy / paste between Copy / paste between applications applications Content Providers gives access to data from other applications Components can bind to services also of other applications, and perform remote procedure calls to interfaces declared using an IDL ICT 19
  • Examples of URLs and intent actions iPhone mailto:frank@example.co m ACTION_SEND tel:1-408-555-5555 CALL tel:2125551212 sms:1-408-555-1212 ACTION_EDIT http://maps.google.com/m content://contacts/1 aps?daddr=San+Francisc VIEW http://web_address o,+CA&saddr=cupertino VIEW (Driving directions geo:0,0?q=my+street+add between San Francisco ress and Cupertino) ACTION_GET_CONTENT ACTION_REBOOT ICT 20
  • Device access iPhone Accelerometer Sensors including Shake events accelerometer, proximity, light, temperature, … Positioning (GPS) Positioning, location provides, Camera GPS status External accessories / BT Camera including settings, Made for iPod licensing preview, snap picture program Currently no Bluetooth API API for accessing current state and listening to state changes for in telephone (network type, cell ids, calls, data traffic…) ICT 21
  • File management iPhone Sandbox Default: each application Each application has its has a unique Linux user own home directory id, and application files are Backup: automatic when only visible to that user id synched using iTunes, all of home directory except cache and tmp directory ICT 22
  • Programming languages iPhone C and Objective C All applications are Compiled to native code developed in Andoid’s No garbage collection, but Java uses reference counters Dalvik VM specific to and reference pools. Android No (official) Java version Android-specific bytecode optimized for minimal memory footprint Libraries do not match any of the standard Java profiles, but covers most of J2ME CDC ICT 23
  • #import <UIKit/UIKit.h> iPhone @interface MyViewController : UIViewController <UITextFieldDelegate> { UITextField *textField; UILabel *label; Objective C NSString *string; code } @property (nonatomic, retain) IBOutlet UITextField *textField; Example @property (nonatomic, retain) IBOutlet UILabel *label; @property (nonatomic, copy) NSString *string; - (IBAction)changeGreeting:(id)sender; @end Header file and implementation - (IBAction)changeGreeting:(id)sender { self.string = textField.text; of one method NSString *nameString = string; if ([nameString length] == 0) { nameString = @"World"; } NSString *greeting = [[NSString alloc] initWithFormat:@"Hello, %@!", nameString]; label.text = greeting; [greeting release]; } Source: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/index.html ICT 24
  • Development tools and profiling iPhone Development requires a Free SDK available for Mac Windows, Mac, and Linux development Any Java development environment can be used Free tools include: Free tools include: XCode IDE Android Development Tools plugin for Eclipse iPhone emulator Android Emulator Instruments (for profiling) Memory and performance Interface Builder profiling Debugging tools UI stress-test tools ICT 25
  • iPhone XCode IDE Source: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/index.html ICT
  • iPhone Interface Builder Used to compose the User interface and main object instances of the iPhone application Source: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/index.html ICT
  • iPhone Interface Builder can connect Events to receiving objects Source: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/index.html ICT
  • iPhone In this example the changeGreeting: method of File’s Owner is triggered by “touch up inside” for the Hello button Source: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/index.html Source: http://developer.android.com/guide/topics/ui/declaring-layout.html ICT
  • References iPhone Apple’s iPhone Dev Center Site: http://developer.apple.com/iphone/ Illustrations from: iPhone Application Programming Guide View Controller Programming Guide for iPhone OS Your First iPhone Application Android’s developer guide Site: http://developer.android.com/guide/ Illustrations from: What is Android? Application Fundamentals User Interface – Declaring Layouts ICT 30