1 / 25

Secrets of an iPhone Developer

Secrets of an iPhone Developer. Brian Robbins Founder, Riptide Games Slides at http://www.dubane.com/cons/ FITC Mobile – September 14, 2009. Today. Programming AudioSession Accelerometer Input Accelerometer Calibration Prevent screen darkening OS 3.0/2.0 compatibility Anti-Hacking

yama
Download Presentation

Secrets of an iPhone Developer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Secrets of an iPhone Developer Brian Robbins Founder, Riptide Games Slides at http://www.dubane.com/cons/ FITC Mobile – September 14, 2009

  2. Today Brian Robbins - slides available: http://www.dubane.com/cons/ • Programming • AudioSession • Accelerometer Input • Accelerometer Calibration • Prevent screen darkening • OS 3.0/2.0 compatibility • Anti-Hacking • NSZombieEnabled • Xcode 3.2 Errors / Warnings • Xcode 3.2 Static Analyzer • Demo • App Development • Provisioning Profile tips • iTunes Connect • App Submission Tips • Analytics tracking • Score / Networking Tools • iPhone Configuration Utility (iPCU) • Other Useful Tools

  3. Today’s Goal Most useful session you attend Brian Robbins - slides available: http://www.dubane.com/cons/

  4. Programming

  5. AudioSession Brian Robbins - slides available: http://www.dubane.com/cons/ • Can use AudioSession APIs • C-based • Or AVAudioSession (SDK 3.0) • Obj-C wrapper into same C calls • Categories: • Ambient – Games, allows background iPod Music Playback and follows ringer switch • SoloAmbient – Same as ambient, but stops iPod Music Playback so use this if you have your own background music • Playback – Use for audio playback apps • Record & PlayAndRecord – For recording and playback

  6. Accelerometer Input Brian Robbins - slides available: http://www.dubane.com/cons/ • Use an adaptive Low-Pass filter, for better response • Full Implementation in the AccelerometerGraph sample application #define FILTERFACTOR 0.1 #define ATTENUATION 3.0 #define MINSTEP 0.02 // Start with the value from a basic low-pass filter basevalue = (newAcceleration * FILTERFACTOR) + (previousValue * (1.0 - FILTERFACTOR)); // Smooth more for small movement to filter out noised = Clamp(ABS(Normalize(basevalue)-Normalize(newAcceleration))/MINSTEP - 1., 0., 1.); // Calculate a proportional factor alpha = (1.-d) * FILTERFACTOR / ATTENUATION + d * FILTERFACTOR; // Use the new factor to offset smoothed values value = newAcceleration * alpha + basevalue * (1. - alpha);

  7. Accelerometer Calibration Brian Robbins - slides available: http://www.dubane.com/cons/ Map to the user’s starting orientation when doing heavy accelerometer control Do this when action starts, and ideally tell the user Sorry (James) no example

  8. Prevent Screen Darkening Brian Robbins - slides available: http://www.dubane.com/cons/ Turn on during gameplay Turn off in menus [UIApplication sharedApplication].idleTimerDisabled = YES;

  9. OS 3.0 / 2.0 compatibility Brian Robbins - slides available: http://www.dubane.com/cons/ • Use OS 3.0 features like MPMusicPicker, without requiring OS 3.0 • Why? OS upgrades on iPod Touch is very low • 4 technical steps • Business rules for behavior

  10. OS 3.0 / 2.0 Compatibility Brian Robbins - slides available: http://www.dubane.com/cons/ • Target > Info > General • Set Framework Linked Library from “Required” to “Weak” • Target > Info > Build • Set Base SDK to latest SDK (ie 3.0) • Target > Info > Build • Set iPhone OS Deployment Target to oldest SDK (ie 2.1) • Check for availability of class before using it • if ([MPMusicPickerController])

  11. Anti-Hacking Brian Robbins - slides available: http://www.dubane.com/cons/ http://thwart-ipa-cracks.blogspot.com/ Very simple detection, can go a lot more complex NSBundle *bundle = [NSBundle mainBundle]; NSDictionary *info = [bundle infoDictionary]; if ([info objectForKey: @"SignerIdentity"] != nil) {/* do something */ } Can also look to see if app is encrypted, check size of info.plist, call home, etc.

  12. NSZombieEnabled Brian Robbins - slides available: http://www.dubane.com/cons/ • Executables > Info > Arguments • NSZombieEnabled value YES • Good for EXC_BAD_ACCESS • BAD for memory!!!

  13. Xcode 3.2 Errors & Warnings Brian Robbins - slides available: http://www.dubane.com/cons/ Use the tabs to see from last build or all builds Can also group by type instead of by class

  14. Xcode 3.2 Static Analyzer Brian Robbins - slides available: http://www.dubane.com/cons/ Uses Open Source Clang analyzer Good for memory references and Obj-C coding compliance Freaking awesome!

  15. Live Demo Brian Robbins - slides available: http://www.dubane.com/cons/

  16. App Development

  17. Provisioning Profile Tips Brian Robbins - slides available: http://www.dubane.com/cons/ • Make and use a single “wildcard” App ID • Nothing but a single * • Use that for all development and provisioning profiles • Unless you’re doing in-app purchase or Push Notification • When adding devices or users make a new Provisioning Profile • ie Riptide_Dev_01, Riptide_Dev_02

  18. iTunes Connect Brian Robbins - slides available: http://www.dubane.com/cons/ • Release Date • When submit, set it to whatever, probably 1-2 weeks in the future • The moment you get approval set the release date to today • For Updates, leave release date as is when submit • Setting to future will remove you from store! • Moment approved, set release date to today

  19. iTunes Connect App Submission Brian Robbins - slides available: http://www.dubane.com/cons/ • Taking ~2 weeks for approval • Every time, even if rejected for app description problem! • Plan for keywords, but don’t use competitor names • Don’t put pricing in your app description • Don’t put keywords in your app title

  20. Analytics Tracking Brian Robbins - slides available: http://www.dubane.com/cons/ Simple, cheap (free) and very easy to implement PinchMedia is good Other major one is Flurry Analytics Not something you need to pay for!

  21. Score / Networking Brian Robbins - slides available: http://www.dubane.com/cons/ Good idea, especially for games Use an existing network to borrow traffic/users OpenFeint, ScoreLoop are biggest open ones Plus+ from ngMoCo is picking up steam, but you have to talk to ngMoCo to use it.

  22. iPhone Configuration Utility Brian Robbins - slides available: http://www.dubane.com/cons/ Search for iPhone Configuration Utility on Apple Site (2.1 latest version) Basically the Xcode Organizer without Xcode Much easier for AdHoc users to install and manage apps

  23. Other Useful Tools Brian Robbins - slides available: http://www.dubane.com/cons/ • MajicRank • http://www.majicjungle.com/majicrank.html • AppViz • http://www.ideaswarm.com/ • MobClix for rank tracking • http://www.mobclix.com/appstore/1 • AppShopper for price history • http://appshopper.com/

  24. Recap Brian Robbins - slides available: http://www.dubane.com/cons/ • Programming • AudioSession • Accelerometer Input • Accelerometer Calibration • Prevent screen darkening • OS 3.0/2.0 compatibility • Anti-Hacking • NSZombieEnabled • Xcode 3.2 Errors / Warnings • Xcode 3.2 Static Analyzer • Demo • App Development • Provisioning Profile tips • iTunes Connect • App Submission Tips • Analytics tracking • Score / Networking Tools • iPhone Configuration Utility (iPCU) • Other Useful Tools

  25. Questions? Slides at http://www.dubane.com/cons/ Brian Robbins www.riptidegames.com Twitter: @dubane brian@riptidegames.com

More Related