Secrets of an iPhone Developer
Shared by: fe7J72f
-
Stats
- views:
- 1
- posted:
- 6/27/2012
- language:
- Latin
- pages:
- 25
Document Sample


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
– 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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Today’s Goal
Most useful session you attend
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Programming
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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 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);
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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;
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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])
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Anti-Hacking
• 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.
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Xcode 3.2 Static Analyzer
• Uses Open Source Clang analyzer
• Good for memory references and Obj-C
coding compliance
• Freaking awesome!
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Live Demo
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
App Development
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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!
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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.
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
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
Sept 14, 2009 Brian Robbins - slides available: http://www.dubane.com/cons/
Questions?
Slides at http://www.dubane.com/cons/
Brian Robbins
www.riptidegames.com
Twitter: @dubane
brian@riptidegames.com
Related docs
Other docs by fe7J72f
En las publicaciones de c�mputo se considera a SQL como una Lengua Libre lingua franca no
Views: 2 | Downloads: 0
Get documents about "