Mobile Development 101

4,921 views

Published on

From Silicon Valley Code Camp 2009. An introduction to developing mobile applications for the iPhone and Android platforms.

Published in: Technology, Business
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,921
On SlideShare
0
From Embeds
0
Number of Embeds
25
Actions
Shares
0
Downloads
238
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide
  • Mobile Development 101

    1. 1. Mobile Development 101: Developing Apps for the iPhone and the Android Platforms Michael Galpin, eBay @michaelg
    2. 2. Why Mobile?
    3. 3. Mobile Transactions 30.0 22.5 $M 15.0 7.5 0 Jan 1, 2008 May 1, 2008 Aug 1, 2008 Oct 1, 2008 Dec 1, 2008 Feb 1, 2009 Apr 1, 2009 Jun 1, 2009 Mobile Web iPhone
    4. 4. Usage Capabilities
    5. 5. Usage Capabilities Phones That Matter Distribution Barriers
    6. 6. What Platforms?
    7. 7. iPhone 50% of Mobile Internet Usage Comprehensive Tools High Volume Distribution Channel
    8. 8. Overview • Programming Language: Objective-C • Tools: XCode/Interface Builder, iPhone SDK • Framework: Cocoa Touch • Features: Multi-threaded, Open GL ES, Contacts, Email, WebKit, iTunes, GPS, Google Maps, (Video)Camera, Local Database, Push Notifications • Pitfalls: Memory management, no background processing, no intra-application communication*, QA, App Store regulations
    9. 9. Objective-C • Derived and compatible with C • C libraries in many cases • Object-oriented • Smalltalk inspired • Surprisingly dynamic
    10. 10. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    11. 11. interface(header) @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    12. 12. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    13. 13. inheritance @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    14. 14. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    15. 15. protocol @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    16. 16. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    17. 17. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; instance variable } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    18. 18. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    19. 19. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } method declarations @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    20. 20. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    21. 21. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; property + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    22. 22. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    23. 23. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; class/static method - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    24. 24. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    25. 25. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; input parameter - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    26. 26. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    27. 27. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; return type @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    28. 28. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    29. 29. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; method name @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    30. 30. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    31. 31. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; instance method - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    32. 32. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    33. 33. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; 1st param - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    34. 34. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    35. 35. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; 2nd param - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    36. 36. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    37. 37. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; 3rd param - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    38. 38. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    39. 39. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; method name + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    40. 40. @interface CurrencyAmount : NSObject <NSCoding> { NSDecimalNumber *amount; NSString *currencyID; } @property (nonatomic, retain) NSDecimalNumber *amount; @property (nonatomic, retain) NSString *currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID; - (id) initWithNode:(XMLNode *) node; - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID locale:(NSLocale *) locale; - (id) initWithLocalizedStringAmount:(NSString *) inAmount currencyID:(NSString *) inCurrencyID; - (id) initWithDecimalAmount:(NSDecimalNumber *) inAmount currencyID:(NSString *) inCurrencyID; - (CurrencyAmount *) currencyAmountByMultiplyingByQuantity:(int) inQuantity; - (CurrencyAmount *) currencyAmountByAdding:(CurrencyAmount *) inAmount; -(NSString*) stringValue; -(NSString*) rawDecimalAsString; -(NSString*) formatStringWithoutCurrency; -(NSString*) formatStringShort:(BOOL) shortForm; -(NSString*) currencyPrefixShort:(BOOL) shortForm; - (NSComparisonResult)compare:(CurrencyAmount *)other; - (BOOL) isZeroAmount; @end
    41. 41. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    42. 42. @implementation CurrencyAmount implementation of interface @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    43. 43. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    44. 44. @implementation CurrencyAmount @synthesize amount; macro getter/setter @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    45. 45. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    46. 46. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; method implementations + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    47. 47. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    48. 48. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } method invocation - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    49. 49. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    50. 50. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"];string literal [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    51. 51. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    52. 52. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } nested call - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    53. 53. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    54. 54. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; this instance return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    55. 55. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    56. 56. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { override superclass [amount release]; [currencyID release]; [super dealloc]; } @end
    57. 57. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    58. 58. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { memory mangement [amount release]; [currencyID release]; [super dealloc]; } @end
    59. 59. @implementation CurrencyAmount @synthesize amount; @synthesize currencyID; + (CurrencyAmount *) zeroAmountWithCurrencyID:(NSString *) inCurrencyID { return [[[CurrencyAmount alloc] initWithDoubleAmount:0.0 currencyID:inCurrencyID] autorelease]; } - (id) initWithNode:(XMLNode *) node { NSString *inCurrencyID = [node attributeValue:@"currencyID"]; [self initWithStringAmount:[node getText] currencyID:inCurrencyID]; return self; } - (id) initWithDoubleAmount:(double) inAmount currencyID:(NSString *) inCurrencyID { amount = [[NSDecimalNumber alloc] initWithDouble:inAmount]; self.currencyID = inCurrencyID; return self; } - (BOOL) isZeroAmount { return [amount compare:[NSDecimalNumber zero]] == NSOrderedSame; } - (void) dealloc { [amount release]; [currencyID release]; [super dealloc]; } @end
    60. 60. Tools
    61. 61. XCode • Full featured IDE • Build, debug • Code navigation, completion • Refactoring • SCM Integration • Wizards
    62. 62. Interface Builder • Drag-and-drop, UI Design Tool • Integrated with XCode • Connect code to UI elements (events)
    63. 63. Instruments • Profiling Tool • Memory Usage • Leaks • CPU Usage • Threads, I/O Monitoring
    64. 64. iPhone Emulator Runs application natively Not all APIs available Some APIs mocked: Location
    65. 65. Cocoa Touch • MVC Framework • AppKit • Controls, Events • UIKit • Accelerometer, Multi-touch
    66. 66. Dangers
    67. 67. Garbage
    68. 68. Don’t Call Me... Push Notifications = Substitute for Background Processing?
    69. 69. App 2 App No formal intra-application communication allowed Custom URL protocols used as hack
    70. 70. QA? Manual provisioning: 100 iPhone
    71. 71. Android • Devices, devices, devices • Open Source: OS, SDK • Language: Java+ • Features: Multi-threaded, Open GL ES, Contacts, Email, WebKit, Media, GPS, Google Maps, (Video)Camera, Local Database, Background Service, Garbage Collection, Intents • Pitfalls: Memory Management, Assault on Battery, Devices, Devices, Devices...
    72. 72. Compiler Dex Compiler Compress Source Code Class files Dex File APK
    73. 73. Java
    74. 74. Tools
    75. 75. Tools
    76. 76. DDMS
    77. 77. Android Runtime & App Framework • Activities & Intents • Separation of Concerns • Launch an Activity based on an • Layout Intent • Application Logic • Application Interop • XML => Bytecode • Layout • Localization
    78. 78. The Web Services Diet Web Services: Made for Servers, not Phones Data Centric vs. Functional Centric Mo’ Data, Mo’ Problems XML = Teh Suck
    79. 79. Try Not to Drown •Images, Audio, Video •Browser features taken for granted •Caching / Cache Management •Simultaneous Loading
    80. 80. Security • What to store on device? • What about stolen devices? • Jailbreaking? • Phishing? • OAuth??? • Hard coding == FAIL
    81. 81. Upgrades? What Upgrades? • Far from automatic • Out of sight, out of mind • Don’t expect upgrades • Lots of versions to manage • Agile Development FTW???
    82. 82. eb le W b i Mo
    83. 83. Mobile Web a.k.a. HTML 5 • One app to rule them all: iPhone, Android, webOS, Blackberry* • Language: JavaScript, HTML, CSS • Tools: ... • Features: Multi-threaded!, Open GL ES, Contacts, Email, GPS, Maps, (Video)Camera, Local Database, Media, Memory Management, Security • Pitfalls: Memory management, no background processing, WebKit versioning
    84. 84. Resources
    85. 85. • iPhone Developer Center • Silicon Valley iPhone Developers • Stack Overflow • MOTODEV • Android Developers • Silicon Valley Android Developers • Android Developers Group
    86. 86. Sprint Developer Conference • October 26-28 • Santa Clara Convention Center • Android, Mobile Web, webOS, RIM, J2ME, WinMo • Coding Camps • Free HTC Hero (Android) • 4G Demo and Beta

    ×