secrets of an iphone developer brian robbins founder, riptide games slides at fitc mobile –...
TRANSCRIPT
Secrets of an iPhone Developer
Brian RobbinsFounder, 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– 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Today’s Goal
Most useful session you attend
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
AudioSession
• 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Accelerometer Input• 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 filterbasevalue = (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 factoralpha = (1.-d) * FILTERFACTOR / ATTENUATION + d * FILTERFACTOR;// Use the new factor to offset smoothed valuesvalue = newAcceleration * alpha + basevalue * (1. - alpha);
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Accelerometer Calibration
• 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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Prevent Screen Darkening
• Turn on during gameplay• Turn off in menus
[UIApplication sharedApplication].idleTimerDisabled = YES;
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
OS 3.0 / 2.0 compatibility
• 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
OS 3.0 / 2.0 Compatibility
1. Target > Info > General– Set Framework Linked Library from
“Required” to “Weak”
2. Target > Info > Build– Set Base SDK to latest SDK (ie 3.0)
3. Target > Info > Build– Set iPhone OS Deployment Target to oldest
SDK (ie 2.1)
4. Check for availability of class before using it– if ([MPMusicPickerController])
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Anti-Hacking
• http://thwart-ipa-cracks.blogspot.com/• Very simple detection, can go a lot
more complexNSBundle *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.
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
NSZombieEnabled
• Executables > Info > Arguments– NSZombieEnabled value YES
• Good for EXC_BAD_ACCESS• BAD for memory!!!
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Xcode 3.2 Errors & Warnings
• Use the tabs to see from last build or all builds
• Can also group by type instead of by class
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Xcode 3.2 Static Analyzer
• Uses Open Source Clang analyzer• Good for memory references and
Obj-C coding compliance• Freaking awesome!
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Provisioning Profile Tips
• 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
iTunes Connect
• 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
iTunes Connect App Submission
• 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Analytics Tracking
• Simple, cheap (free) and very easy to implement
• PinchMedia is good• Other major one is Flurry Analytics• Not something you need to pay for!
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Score / Networking
• 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.
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
iPhone Configuration Utility
• 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Other Useful Tools
• 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/
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Recap• 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
Brian Robbins - slides available: http://www.dubane.com/cons/ Sept 14, 2009
Questions?Slides at
http://www.dubane.com/cons/
Brian Robbinswww.riptidegames.com
Twitter: @[email protected]