41
Welcome to CS193P iPhone Application Development Evan Doll [email protected] Paul Marcos [email protected] 1 Tuesday, September 23, 2008

Standford CS 193P: 01-Introduction

Embed Size (px)

Citation preview

Page 1: Standford CS 193P: 01-Introduction

Welcome to CS193PiPhone Application Development

Evan [email protected]

Paul [email protected]

1Tuesday, September 23, 2008

Page 2: Standford CS 193P: 01-Introduction

Introductions

• Lecturers■ Paul Marcos <[email protected]>■ Evan Doll <[email protected]>

• Student TAs■ Troy Brant <[email protected]>■ Kayvon Beykpour <[email protected]>

• Industry “TAs”■ Adam Nash <[email protected]>■ Joe Bernstein <[email protected]>

2Tuesday, September 23, 2008

Page 3: Standford CS 193P: 01-Introduction

Quick Survey• Have worked with Java or C++?• Have an Intel-based Macintosh?• Have done Mac OS X development?• Have installed the iPhone SDK and done iPhone

development?

3Tuesday, September 23, 2008

Page 4: Standford CS 193P: 01-Introduction

Logistics• Lectures: Packard 101

Tues & Thurs 12:50 - 2:05 PM• Prerequisite: CS 106B/X• Recommended Book: None, we’ll use Apple documentation• Required Hardware:

■ You must have access to an Intel-based Macintosh

• Required Software: ■ Mac OS X 10.5.4 Leopard (or later)■ iPhone SDK

• iPhone SDK is not currently available on cluster computers

4Tuesday, September 23, 2008

Page 5: Standford CS 193P: 01-Introduction

Office Hours & Web Site• Office hours

■ TBD, will be posted on web site and via email

• Email■ [email protected]

• Web site■ http://cs193p.stanford.edu■ Access restricted to some materials

5Tuesday, September 23, 2008

Page 6: Standford CS 193P: 01-Introduction

Enrollment• Response has been phenomenal!• Enrollment limited to 50 students• You MUST fill out a survey to be considered

■ http://tinyurl.com/CS193P■ Need to be completed by noon tomorrow (8/24)

• Priority will be given as follows:■ completed CS106B/X and 108 (or equiv. industry experience)■ prior C and OOP experience■ students close to graduating■ CS majors

• If you don’t get enrolled, you are welcome to audit■ You must inform us that you’re auditing

6Tuesday, September 23, 2008

Page 7: Standford CS 193P: 01-Introduction

Why Are We Here?

To build iPhone & iPod touch applications using Cocoa Touch

7Tuesday, September 23, 2008

Page 8: Standford CS 193P: 01-Introduction

Why Are We Here?• 193P is not just about the iPhone, Cocoa Touch or ObjC• It’s about Software Engineering, as well as object oriented

architecture and design• Exposure to problems and solutions that you might not see in

other classes

8Tuesday, September 23, 2008

Page 9: Standford CS 193P: 01-Introduction

Stanford iPhone Pilot• Applications by Stanford students for Stanford students• Project information:

■ http://studentapps.stanford.edu/iapps.html

• Details on the current applications■ http://stanford.terriblyclever.com

• Contact Joe and Kayvon for more details about the program• Keep in mind for final projects

9Tuesday, September 23, 2008

Page 10: Standford CS 193P: 01-Introduction

Cocoa Touch & iPhone SDK• The Good

■ Based on Cocoa which is mature, well thought out with highly consistent APIs

■ Provides a very rich starting point for exploring app design■ Shows “real-world” implementations of OO design patterns■ Designs learned on iPhone translate directly to Mac OS X

• The Bad■ 1.0 version of SDK, bound to be some rough edges■ Exploring new territory with classroom device development

• The Ugly■ iPhone developer agreement

10Tuesday, September 23, 2008

Page 11: Standford CS 193P: 01-Introduction

Buzz about the class• Bloggers asked, “How can they teach the class with Apple’s

NDA?”

“Basically, it's like Fight Club.

Once you enroll in the iPhone developer program, you're not allowed to talk about the developer program, the SDK, or pretty much anything until Apple says it's OK.”

11Tuesday, September 23, 2008

Page 12: Standford CS 193P: 01-Introduction

iPhone Developer University Program• Some materials for the class still covered by confidentiality

clause■ Existing iPhone developer program restricts who developers can

talk to about SDK details■ University program allows schools to create teams of students

who can talk to each other, exchange applications, etc.

• Students will be “invited” to join our CS193P team■ Accepting invitation includes agreeing to honor these terms

• Once accepted, you can download the SDK…and we can talk

12Tuesday, September 23, 2008

Page 13: Standford CS 193P: 01-Introduction

R STUDENTS STRONGLY CAUTIONED

SOME MATERIAL MAY BE INAPPROPRIATE FOR STUDENTS WHO HAVE NOT ACCEPTED THE UNIVERSITY AGREEMENT

For brief exposure to confidential API and details about iPhone OS. Do not discuss with anyone not enrolled in this class.

THIS CLASS HAS BEEN RATED

13Tuesday, September 23, 2008

Page 14: Standford CS 193P: 01-Introduction

Things We’ll Cover

14Tuesday, September 23, 2008

Page 15: Standford CS 193P: 01-Introduction

Xcode Interface BuilderTools

Language (& Runtime) Objective-C

[textView setStringValue: @“Hello”];

Frameworks

Foundation UIKit

15Tuesday, September 23, 2008

Page 16: Standford CS 193P: 01-Introduction

Why Objective-C?• Exposure to other languages is always good• ObjC is a language focused on simplicity and the elegance of

OO design■ Based on ANSI C■ Brings many object oriented principles, but with a minimal

amount of syntax

• A data point to compare with designs of C, C++ and Java

16Tuesday, September 23, 2008

Page 17: Standford CS 193P: 01-Introduction

Applications You Will Build

HelloStanford & Obj-C Tool

HelloPoly - 2 weeks

Presence - 4 weeks

Final Project (your choice) - 3 weeks

17Tuesday, September 23, 2008

Page 18: Standford CS 193P: 01-Introduction

Assignments, Grading & Late Policy• 7 weekly assignments• Final project of your choice

■ End of quarter demos at Apple...

• Grading: Nice & simple: ✓, ✓+ and ✓-• Late Policy: 3 late days, use them wisely!

18Tuesday, September 23, 2008

Page 19: Standford CS 193P: 01-Introduction

First Assignment• First assignment handed out today, 2 parts• Intended to get you situated with tools and start off with Obj-C• Includes a comprehensive walkthrough• We suggest trying to do Assignment 1A before Thursday to

help work out any tools or installation issues

19Tuesday, September 23, 2008

Page 20: Standford CS 193P: 01-Introduction

Second Assignment: Presence• Build a fully functional application from scratch over 4 weeks• Each assignment builds on the previous one

■ Don’t fall behind!

• Covers a wide variety of topics in the UIKit framework...

20Tuesday, September 23, 2008

Page 21: Standford CS 193P: 01-Introduction

PresenceBird’s Eye View

21Tuesday, September 23, 2008

Page 22: Standford CS 193P: 01-Introduction

What We’ll Cover• Application design patterns• View controllers• Presenting data

■ Table views

• Loading & saving data■ Property lists, SQLite, web services

• Text input• Performance tuning• Address Book and other system integration• More...? Suggestions welcome!

22Tuesday, September 23, 2008

Page 23: Standford CS 193P: 01-Introduction

Final Projects• 3 weeks to work on them• Application of your choice• It’s never too early to think of something and propose it to us• Categories to consider:

■ Student life apps■ Educational tools■ Games■ Social / location-aware software

• Find a project that you or your friends would actually like to use!

• Post it on the app store?

23Tuesday, September 23, 2008

Page 24: Standford CS 193P: 01-Introduction

Questions?

24Tuesday, September 23, 2008

Page 25: Standford CS 193P: 01-Introduction

iPhone OS Overview

25Tuesday, September 23, 2008

Page 26: Standford CS 193P: 01-Introduction

Media

Core Services

Core OS

Cocoa

Touch

Mac OS X

iPhone OS

iPhone

26Tuesday, September 23, 2008

Page 27: Standford CS 193P: 01-Introduction

Core Services

Collections Core Location

Address Book Net Services

Networking Threading

File Access Preferences

SQLite URL utilities

Media

Core Audio JPG, PNG, TIFF

OpenAL PDF

Audio Mixing Quartz (2D)

Audio Recording Core Animation

Video Playback OpenGL ES

Cocoa Touch

Multi-Touch Events Alerts

Multi-Touch Controls Web View

Accelerometer People Picker

View Hierarchy Image Picker

Localization Camera

Media

Core Services

Core OS

Cocoa Touch

iPhone OSCore OS

OS X Kernel Power Mgmt

Mach 3.0 Keychain

BSD Certificates

Sockets File System

Security Bonjour

27Tuesday, September 23, 2008

Page 28: Standford CS 193P: 01-Introduction

Xcode Interface BuilderTools

Language (& Runtime) Objective-C

[textView setStringValue: @“Hello”];

Frameworks

Foundation UIKit

28Tuesday, September 23, 2008

Page 29: Standford CS 193P: 01-Introduction

Cocoa Touch Architecture

Cocoa Touch

UIKit User interface elementsApplication runtimeEvent handlingHardware APIs

Foundation Utility classesCollection classesObject wrappers for system servicesSubset of Foundation in Cocoa

29Tuesday, September 23, 2008

Page 30: Standford CS 193P: 01-Introduction

Objects

30Tuesday, September 23, 2008

Page 31: Standford CS 193P: 01-Introduction

Thing

Object

31Tuesday, September 23, 2008

Page 32: Standford CS 193P: 01-Introduction

Thing

doSomething

Behavior

behavior

32Tuesday, September 23, 2008

Page 33: Standford CS 193P: 01-Introduction

Thing

doSomething

Message

"doSomething"

33Tuesday, September 23, 2008

Page 34: Standford CS 193P: 01-Introduction

Thingflagcount

doSomething

State

state

behavior

34Tuesday, September 23, 2008

Page 35: Standford CS 193P: 01-Introduction

Thingflagcount

doSomething

Other Objects As State

helperstate

doSomethingElse

Other Thing

performDifficultTask

behavior

35Tuesday, September 23, 2008

Page 36: Standford CS 193P: 01-Introduction

Controllersliderlabel

updateLabel

Outlets Need to decide what the demo would be and update slide to appropriate material.

- text field / slider?

- color tabs?

Need to decide what the demo would be and update slide to appropriate material.

- text field / slider?

- color tabs?

36Tuesday, September 23, 2008

Page 37: Standford CS 193P: 01-Introduction

Controllersliderlabel

updateLabel

Target / Action

targetaction ʻupdateLabelʼ

37Tuesday, September 23, 2008

Page 38: Standford CS 193P: 01-Introduction

Demo

38Tuesday, September 23, 2008

Page 39: Standford CS 193P: 01-Introduction

Outlets

Controllersliderlabel

updateLabel

39Tuesday, September 23, 2008

Page 40: Standford CS 193P: 01-Introduction

Target / Action

Controllersliderlabel

updateLabel

targetaction ʻupdateLabelʼ

40Tuesday, September 23, 2008

Page 41: Standford CS 193P: 01-Introduction

Questions?

41Tuesday, September 23, 2008