COMP446_Fall_2012_Lecture_2

Download Report

Transcript COMP446_Fall_2012_Lecture_2

COMP 446 / ELEC 446
Mobile Device Applications
Scott Cutler
Professor in the Practice of Computer Technology
Department of Computer Science
Department of Electrical and Computer Engineering
[email protected]
8/22/12
Wednesday 2-3:30, DH 1046
Agenda
 Events of the Week
 Housekeeping
 Syllabus
 Next week’s assignment and class
 A little more on Objective C
 Questions on Assignment #1
 Steve Job’s Legacy (if we have time)
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
2
Events of the Week background
 MIT’s Area Exam


Rapidly learn a topic
Keep abreast of your surroundings and how that will impact
you and your specialty.
 Was the most important thing ingrained in me from 7
years at MIT
 These are the prime skills required of a CTO and are
the foundation of ELEC/COMP 694
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
3
Events of the Week
 Jury decides Samsung infringed on Apple patents
 Impact on Apple, Samsung, Nokia, MSFT, HTC
 Windows 8 RTM along with VS 2012
 Regulators OK Verizon's $3.9B bid to buy cable spectrum
 As first 'lockup' ends, Facebook stock drops 5 percent
 A Look Inside Microsoft's SkyDrive Cloud Service
 iPad Mini Name 'Confirmed'
 Apple becomes world's most valuable public company
 Best Buy suspends forecast as fiscal Q2 profit slides 91%
 Dell Stock Plummets as PC Price Wars Intensify
 Dell and HP Missing the Mobile Boat
 HP to Report its Biggest Quarterly Loss in History
 Dell Names Ex-HP Exec to Head Enterprise Solutions Unit
 Amazon Announces September 6 Press Conference; Mum on Details
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
4
Current Roster
 Victor Acuna
 Ryan Artecona
 Gbenga Badipe
 Joel Baranowski
 Peter Chang
 Joan Chao
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
5
Current Roster (2)
 Alex Chiu
 Heaven Chen
 Lingo Dai
 Weibo He
 Sahil Hingorani
 Zhehao Li
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
6
Current Roster (3)
 Abdul Nimeri
 Bill Robertson
 Frank Salinas
 Tyler Siegert
 Austin Witt
 Matthew Zhao
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
7
Software
 Course Website: www.comp446.com

assignment submission website linked through www.comp446.com
 iPhone Developer Program



iPhone Documentation available at http://developer.apple.com
Students will be enrolled in Rice’s iPhone University Developer’s
Program
You should have already responded to invitations
 Xcode available free on Macs
 Remember User: xcode, Password: xcode
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
8
Assignment Files
 Unless otherwise instructed, submit assignment files
as a zip file of Xcode project directory.
 Ensure that all resources are part of the project
directory so they are included in zip.
 Clean project before archiving. Greatly reduces size.
 Screen shots or PDF documents preferred for some
assignments (when indicated).
 OK to make multiple submissions when both file types
needed – but not of individual Xcode project files.
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
9
Optional Sessions and Support
 Monday office hours with TA Richard Latimer. 4:00pm Mudd
 Additional session Thursday, 9pm on 8/30 and 9/6.
 Ability to email questions to me at any time.

Can email Richard Latimer as well.
 Level of support will vary over semester



High level of support at the beginning.
Support decreasing each project as over time as knowing
where to look or how to debug is a very important skill for
you to learn.
Richard instructed to respond conceptually – not just provide
solutions.
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
10
COMP 446 (tentative) Syllabus

Lecture 1 - 8/22/12 - Introduction








1, 2
#2 – Function Calculator
Friday, 9/7 6:00 am (Thursday 30:00)
Watch before:
Assignment:
Assignment due:
3, 4 (demo part)
#3 – Graphing Universal Calculator
Tuesday, 9/18 6:00 am (Thursday 30:00)
Lecture 4 - 9/12/12 - Assignment 3 issues and questions from videos




Watch before:
Assignment:
Assignment due:
Lecture 3 - 9/05/12 - Assignment 2 issues and questions from videos


None
#1 - Calculator
Friday, 8/31 6:00 am (Thursday 30:00)
Lecture 2 - 8/29/12- Assignment 1 issues and questions from videos


Watch before:
Assignment:
Assignment due:
Watch before:
Assignment:
Assignment due:
4 (post demo), 5, 6
Continue with #3 – Graphing Universal Calculator
Tuesday, 9/18 6:00 am (Monday 30:00)
Lecture 5 - 9/19/12 - Assignment 3 issues and questions from videos



Watch before:
Assignment:
Assignment due:
SEC - 8/22/12
Watch 7 before class, 8 after class
#4 – Fiickr Top Places
Friday, 9/28 6:00 am (Thursday 30:00)
COMP 446 / ELEC 446 - Week 1
11
COMP 446 (tentative) Syllabus

Lecture 6 - 9/26/12 - Assignment 4 issues and questions from videos





Watch before:
Assignment:

Assignment due:
10 (after Tab Bar), 11, 12
1: #6 – Fiickr Core Data
- Likely to be broken into required and optional parts
- Optional part required for A+
2: Final Project Topic (due before next class)
Friday, 10/12 6:00 am (Thursday 30:00)
Lecture 8 - 10/10/12 - Assignment 6 issues and SQL




8, 9 very beginning of 10
#5 – Fiickr Map Places
Friday, 10/5 6:00 am (Thursday 30:00)
Lecture 7 - 10/03/12 - Assignment 5 issues and questions from videos


Watch before:
Assignment:
Assignment due:
Watch before:
Assignment:
Assignment due:
13, 14
Final Project Proposal
Tuesday, 10/16 6:00 am (Monday 30:00)
Lecture 9 - 10/17/12 - iOS 6



Watch before:
Assignment:
Assignment due:
SEC - 8/22/12
Optional 15, 16
iOS 6 app
Friday, 10/26 6:00 am (Thursday 30:00)
COMP 446 / ELEC 446 - Week 1
12
COMP 446 (tentative) Syllabus

Lecture 10 - 10/24/12 – HTML 5







Assignment:
Assignment due:
Continue working on Final Project
Wednesday, 11/28 2:00pm
Assignment:
Assignment due:
Continue working on Final Project
Wednesday, 11/28 2:00pm
Lecture 14 - 11/21/12 – No class, but continue on final project



Continue working on Final Project
Wednesday, 11/28 2:00pm
Lecture 13 - 11/14/12 - Individual meetings on Final Project


Assignment:
Assignment due:
Lecture 12 - 11/7/12- Android vs. iOS vs. Windows Phone group debate


Optional 17, 18
Major Final Project Feature
Friday, 11/2 6:00 am (Thursday 30:00)
Lecture 11 - 10/31/12 - TBD


Watch before:
Assignment:
Assignment due:
Assignment:
Assignment due:
Continue working on Final Project
Wednesday, 11/28 2:00pm
Lecture 15 - 11/28/12 - Final Presentations


Assignment:
Assignment due:
SEC - 8/22/12
Document Final Project
By time assigned for COMP 446 final (there is NO final exam)
COMP 446 / ELEC 446 - Week 1
13
Final Project
 To be determined by 8th class
 Can target iOS, Android or WP device
 Proposal submitted by 10/10/12
 Full Spec 10/17/12
 Various milestones including presentation to class on 11/28/12
 Final code for project incorporating comments from presentation
due on the official finals date of the course.
 This is VERY important: If you do not have a great project
definition, the 2nd half of the course will suffer. With a great project,
this will be an exciting course.
 Great if your project could have life after the class finishes
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
14
Week 3
 Watch CS193p lectures #3 and #4 (demo part) before class
 Complete CS193p Assignment #2

Try and complete before next class. Due shortly after next class.
 Submit assignments, review lectures at www.comp446.com
 Start thinking about big project
 Next week’s lecture – mostly review of Objective C fundimentals
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
15
Discussion
Who is Paul Hegarty
 Better question: Why is an Objective-C string
called NSString
 How are these two questions related and why
is it relevant to the high quality of these
videos.
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
17
Object-Oriented Terms
 Class
(description/template for an object)
 Instance
(manifestation of a class)
 Instance Variable
 Message
 Method
(sent to objects to make them act)
(code invoked by a Message)
 Inheritance
(code-sharing mechanism)
 Super/Subclass
 Protocol

(object-specific storage)
(Inheritance relationships)
(.h without .m with other objects announcing suport)
Source: CS193p Lecture #1
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
18
Xcode 4 - You’ve learned how to ...

Create a new project with a single MVC

Show various files in your project (via Navigator or clicking on bars at the top of files)

Show and hide the Navigator, Assistant Editor, Console, Object Library, Inspector

Drag objects into your view and edit their size, position and object-specific display
attributes

Ctrl-drag to connect objects in your View to the code in your Controller (outlets and actions)

Show connections to outlet @propertys and action methods (by mouse-over or right click)

Get quick help (option click) or full documentation (option double-click) for symbols in your
code

Run your application in the simulator

Click on warning (yellow) and error (red) indicators to see problems in your code

Create a new class (like CalculatorBrain) using the File menu’s New File ... item

Create browser-like tabs to organize your viewing of your project
Source: CS193P 2011 Lecture 3
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
19
Objective C - You’ve learned how to ...

Define a class’s public @interface and private @implementation in a .h and .m file
respectively

Add a private @interface to .m file

Create a @property, both for a primitive type (like BOOL) and a pointer (like
NSMutableArray *)

Use nonatomic in @property declarations

Use strong or weak in @property declarations of pointers to objects

Use @synthesize to create a @property’s setter and getter and backing instance
variable

Use “= _propertyname” to choose the name @synthesize uses for its backing instance
variable

For pointers to an object, use either the special type id or a static type (e.g. UIButton *)

Declare and define an Objective C method (e.g. pushOperand: or popOperand).

Declare local variables both of type “pointer to an object” (id or static type) and primitive
type
Source: CS193P 2011 Lecture 3
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
20
Objective C - You’ve learned how to ...

Invoke an Objective C method (using square bracket [] notation)

Invoke a setter or getter using dot notation (e.g. self.operandStack or self.display.text)

Lazily instantiate an object by implementing your own @property getter (operandStack & brain)

Wrap a primitive type (like double) in an object (using NSNumber)

Log formatted strings to the console using NSLog()

Use a “constant” NSString in your code using @“” syntax (e.g. @“+”)

Add and remove an object from an NSMutableArray (the last object anyway􀀁).

Use alloc and init to create space in the heap for an object (well, you’ve barely learned this).

#import the .h file of one class into another’s (CalculatorBrain.h into your Controller)

Create a string by asking a string to append another string onto it

Create a string with a printf-like format (e.g., [NSString stringWithFormat:@“%g”, result])

Perhaps you’ve learned even more if you’ve done Assignment #1!
Source: CS193P 2011 Lecture 3
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
21
Syntax Conventions
 Class object capitalized

NSObject, NSArray, etc.
 Method names are lower case

stringByAppendingString
 Instances of classes are in lower case

self, myBrain
 Long names have capitals bounding words

stringByAppendingString
 Brain is not the same as brain
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
22
(almost) Everything is an Object
 Classes, instances, types, colors
 Major exceptions are C-structs as are numbers (but
not NSNumbers)
 You can send messages to classes
 [[MyClass alloc] init];
 [NSString stringByAppendingString]
 (ClassName) does not change an object’s class, but
tells Xcode that it can assume object is of class
ClassName.
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
23
To * or not to *
 An object instance variable is only a pointer


Initially set to nil (which is 0)
You can safely send messages to nil
 NSString foo = @”This is not correct syntax”;
 NSString *foo =@”This is correct syntax”;
 id foo = @”id types do not use a *”;
 We will latter see **foo implying a pointer to a pointer.
SEC - 8/22/12
COMP 446 / ELEC 446 - Week 1
24
Assignment #1 Questions
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
25
THE LEGACY OF STEVE JOBS
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
26
Waves of Technology
 Every 10 years or so, something big changes

Core leaders of this technology often young
 Luck or Skill



Many people have one great idea, some two
Few have one great idea after another
Often requires excellence in multiple areas
 Risk and Failure
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
27
First or Best
 Being first gives you a head start, but also
paints a target for those who follow behind.
 Steve Jobs often took an existing area and
through a set of bold moves changed the
paradigm giving people what they really
wanted – or would discover that they needed.
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
28
Importance of Owning Solution
 Allows differentiation and future shaping in cost
competitive environment.
 Eases introduction of new technology
 Enables bold moves
 Great competitive barrier to entry
 But can also cost significant business if not at or near
best of breed in an important area.
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
29
Master of Presentations
 1983 Apple Keynote-The "1984" Ad Introduction

1984 Superbowl Commercial
 The Lost 1984 Video: young Steve Jobs introduces the
Macintosh
 The charisma of Steve Jobs (video roundup)
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
30
Hyperbole
 Apple iPad Keynote in 2 minutes! [HD]
 Back To The Mac in 104 seconds
 Incredible amazing awesome Apple

The Original Apple Keynote Cutdown. No cuts are repeated.
Done with iMovie, which is really awesome...
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
31
My Most Famous Picture
Yep, it’s me
SEC - 8/31/11
COMP 446 / ELEC 446 - Week 2
32
Discussion