iphone app dev overview - mobile dev camp vietnam 1

48
iPhone App Dev Overview for Vietnamese coders Huy @ multinc.com 1

Upload: huyzing

Post on 18-May-2015

3.303 views

Category:

Technology


0 download

DESCRIPTION

An overview from A to Z of what it takes to develop applications for the iPhone or iPod Touch, from a Vietnam perspective: setting up, designing, coding, testing, releasing.

TRANSCRIPT

Page 1: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

iPhone App DevOverview for Vietnamese coders

Huy @ multinc.com

1

Page 2: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Warning !

This presentation may contain information on unethical activities, possibly illegal in certain

jurisdictions.

Listen & act at your own risk.

2

Page 3: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Note about DemosThis presentation makes significant use of live demos, which are not included in the slides.

3

Page 4: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Why this talk?

Global opportunity

Few coders in Vietnam

iPhone leads the mobile future

The entire process is quite complex

4

Page 5: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Outline

Part 1 - getting ready

Part 2 - designing

Part 3 - coding

Part 4 - releasing

5

Page 6: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Get readyPart 1

6

Page 7: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Which dev device?iPhone 3GS

iPhone 3G

iPhone 2G

iPod Touch

App Store, multitouch,

accelerometercellular data,

camera

GPS, 3G data

video, autofocus, compass, more speed & RAM

Yes Yes Yes Yes

Yes Yes Yes

Yes Yes

Yes

7

Page 8: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Getting a dev device

Choices:

1. iPhone 3GS ($589 new in US)

2.iPhone 3G/2G (3G $300 on US craigslist)

3.iPod Touch (about $160 on US craigslist)

4.iPhone Simulator (free)

Alternative: test at MultiNC in Q.1 (free++)

8

Page 9: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Apple restrictions

Phone: any carrier

Any web apps

App Store apps

Any apps

Unlocked iPhone or iTouch

iPhone or iTouch

iPhone or iTouch

Jailbroken iPhone or iTouch

9

Page 10: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Shhh...jailbreaking devicePRO: required for software unlock

PRO: install any app

PRO: dev tools

PRO: access to private APIs

CON: have to wait for updateshttp://iphone-dev.org

10

Page 11: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

SDK requirements

Choice of computer:

1. MacCON: expensive

2.PC with “Hackintosh”, “OSX86”CON: time-consuming, maybe not possible, not legal

Alternative: open-source toolchain

11

Page 12: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Mac

Macbook 2.4GHz is fine - $800 on US craigslist

Mac Mini 2GHz should be fine - $500? on US craigslist

4GB of RAM is cheap

Speed bottleneck is not building -- it’s transferring to device

12

Page 13: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Hackintossshhh...New PC

Choose carefullyhttp://osx86.org

Existing PC

Desktop - may need to buy video card

Notebook - may need to buy Wi-Fi, maybe not possible

AMD - forget it

13

Page 14: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Learning to code

Lots of books

Apple’s extensive documentation

Stanford CS193p course-> Google [stanford iphone]

Upcoming MultiUni courseshttp://multiuni.org

14

Page 15: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

iPhone Dev ProgramWhy?

To test on non-jailbroken devices

To release to App Store

How much? $99 per year

Workarounds?

Test/deploy on jailbroken devices

Share certs with other coders

15

Page 16: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

DEMO: iPhone Dev Program

16

Page 17: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

DesignPart 2

17

Page 18: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Why design?

To sell more

To avoid rejection from the App Store

18

Page 19: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Design Resources

Guides

Apple’s Human Interface Guidelines (HIG)

Stencils

http://theresaneil.wordpress.com/2009/09/16/iphone3g-design-resources/

19

Page 20: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Design Worflow

Common:

TapTapTap’s process:

Iterate UI design with a graphic designerhttp://www.taptaptap.com/blog/the-design-session/

If remote, use Skitch

20

Page 21: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Design Process

Iterate:

DEMO: Convert design evolutionhttp://www.taptaptap.com/blog/convert-design-evolution/

21

Page 22: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Type of app

Web app

PRO: no approval needed

CON: requires net, slower response, no games

Native app

App Store vs. jailbroken

more later during Release part...

22

Page 23: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

CodePart 3

23

Page 24: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Web App

Toolkits

DEMO: jQTouch

iui

The rest of this talk is about native apps

24

Page 25: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Languages & ToolsObjective-C -> XCode

Alternatives:

Javascript/HTML -> Appcelerator Titanium, PhoneGap, Ansca Corona (good for games)

careful, Apple hates Phonegap

Ruby -> Rhodes Rhomobile

.NET -> MonoTouch

others...

25

Page 26: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Objective-C

Superset of C, can be mixed with C, C++

Distinctions

Message-passing for method calls

Alloc/release/autorealease

Categories

26

Page 27: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Set up Xcode

DEMO

Files, targets, configurations

Layered settings: project vs. target

GCC

Set up warnings

Subversion (but consider Git)

27

Page 28: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Interface Builder

Not required, can be done programatically

But rapid prototyping of views

DEMO

28

Page 29: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Code structureDEMO of simple app

29

Page 30: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

iPhone SimulatoriPhone Simulator

Missing: location, many preferences, multi-touch (has pinch)

iSimulate

Multi-touch

Accelerometer

Location/GPS

30

Page 31: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Coding style

Apple’s coding guidelines for Cocoa

Google’s Objective-C Style Guide

31

Page 32: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Debugging

NSLog

UIAlertView

NOTE: popups are stacked

Debugger

DEMO

NSZombieEnabled

32

Page 33: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Running static analyzer

Choices:

Download LLVM/CLang Static Analyzer

Bundled in Xcode 3.2 (OS X 10.6)

DEMO

33

Page 34: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Running Xcode LeaksDEMO

34

Page 35: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Deploying for testing

Distribution choices:

a)collect devices’ UDIDs & distribute Ad Hoc

b)share your certificates

c) jailbroken phones don’t require signing

IMPORTANT: keep copy of .dSYM files

35

Page 36: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Beta testing

Collect console logs using iPhone Configuration Utility

Collect console logs and user data using Flurry or others

Collect crash logs from users

Users need to sync and find files on Mac

Analyze using symbolicate and .dSYM files

36

Page 37: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

ReleasePart 4

37

Page 38: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Release to App Store

PRO: Easier access, greater exposure

PRO: Apple handles billing, gives you 70%

CON: infamous App Store approval process (weeks or months, possibly never)

38

Page 39: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Release to Cydia Store (jailbroken devices)

PRO: No approval needed

PRO: Unique markets, especially Vietnam

PRO: Access to more functionality

CON: Smaller market, exposure

39

Page 40: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

App Store rejection examples

Bugs

Private APIs

Downloaded code

Non-working test account

40

Page 41: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

App Store rejection examples

Bad design (e.g. deselected tableview); re-using system icons; connectivity handling; feature-limited

Excess vibration, bandwidth

Uploading user data without warning

But exceptions: “Don’t ask, don’t tell”

41

Page 42: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

App Store rejection examples

Objectional content, e.g. Me So Holy, Baby Shaker, StarTime, Eucalyptus, Ninjawords, NIN

Competing with Apple & carriers, e.g. Google Voice & Skype

Trademark, e.g. iPhone icon & name, Polaroid

Icons that match, icons that don’t match

Bad descriptions (“dragons”, competitor

42

Page 43: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

MarketingApp Store ranking

Online reviews, Public Relations

Video demos, using iSimulate

Word-of-mouth

Excellence -> Apple featured, marketing

Free “lite” version

Pricing strategy

Appirater?43

Page 44: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

TapTapTap’s advertising of “Where To”

44

Page 45: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

What kind of apps?

Utility, productivity

Business?

Careful because officially not allowed

Casual games, e.g. Pee monkey

Arcade games, e.g. Meteor Blitz

DEMO: Meteor Blitz video demo

45

Page 46: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Retire richPart 5

46

Page 47: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

What now?

Get a Mac/Hackintosh

Download the SDK

Learn from Stanford course, MultiUni

47

Page 48: iPhone App Dev Overview - Mobile Dev Camp Vietnam 1

Free 6-day course:Intro to iPhone &

Objective-CGo to http://multiuni.org/ for details

48