Wednesday 2-4, KH 105 COMP 446 / ELEC 446 Mobile Wireless Services Project Scott Cutler Professor in the Practice of Computer Technology Department of Computer Science Department of Electrical and Computer Engineering Beatles Day 9/09/09
Today’s Agenda Events of the week Announcements / Infrastructure Updates Apple Speak Last Week’s assignments Next Week Assignments 2a and 2b due by 9/16/2009 SEC - Beatler Day COMP 446 / ELEC Week 32
Events of the Week Apple Beatle’s Day Announcement Intel brings faster CPUs to the maintream Nokia unveils N97 Mini iPhone will get MMS September 25 T-Mobile unveils pay-as-you-go Android phone Apple Store Robbery Took 31 Seconds Microsoft granted stay of Word injunction Windows Mobile 6.5 Will Debut on 3 LG Phones Zune HD Will Stand Alone in Battle with iPod SEC - Beatler Day COMP 446 / ELEC Week 33
Current Roster Britt Antley ELEC, GR, Rohan Balsaver ELEC, GR, Chris Boyd IT, Hailey Hinson IT, Skyler Johnson COMP, JR, Jones, Sandhya Pai ELEC, GR, Rick Song SS, Duncan, Yiming Wang ELEC, GR, SEC - Beatler Day COMP 446 / ELEC Week 34
COMP 446 Syllabus 8/26/09Introduction / What makes mobile apps special Assignment:Load Visual Studio – Due 9/2/09 9/2/09Intro to Mac OS X and Cocoa Touch, Objective-C, Dev Tools Using Objective-C, Foundation framework Videos:Skim: Lecture 1 (Intro to Mac OS X and Cocoa Touch, Objective-C, Dev Tools) Skim: Lecture 2 (Using Objective-C, Foundation framework) Assignment: Hello Rice [1a] and WhatATool 1 [1b] (Due Beatles’ Day) Beatles’ DayDiscussion of first applications Videos:Lecture 3 (Custom classes, Memory Management, ObjC Properties) Lecture 3a (Intro to XCode and Debugging – pdf only, no video) Lecture 4 (Interface Builder, Controls, Target-Action) Assignment: WhatATool 2 [2a] and HelloPoly I [2b] (Due 9/16/09) 9/16/09ASP.Net Videos:Lecture 5 (Views and Drawing, Animations) Lecture 6 (View Controllers Basics) Assignment: HelloPoly II [3] (Due 9/23/09) 9/23/09Creating and Consuming Web Services Videos:Lecture 7 (Navigation Controllers) / Lecture 8 (Table Views) Assignment: Presence 1 (Due 9/30/09) 9/30/09Stanford Final Presentations Videos:Lecture 9 (Dealing with Data: User Defaults, SQLite, Web Services) Lecture 10 (Threading, Caching and Memory) Assignment: Presence 2 (Due 10/07/09) 10/7/09SQL 101 Videos:Lecture 11 (Text Input, Responder Chain, Presenting Content Modally) Lecture 12 (Address Book) Assignment: SQL Query (Due 10/14/09) 10/14/09Browser Capabilities Videos:Lecture 13 (Searching, Notifications) / Lecture 14 (Mulittouch) Assignment: Website Leveraging Browser Capabilities (Due 10/21/09) 10/21/09iPhone Web Apps Videos:Lecture 15 (Device APIS: Image Picker, Core Location, Accelerometer, Battery Life) Lecture 16 (Bonjour, Streams, Networking) Assignment: iPhone Web Site (Due 10/28/09) 10/28/09Optimizing OpenGL for iPhone (Video 15a) Videos:Lecture 17 (Audio, Video, Web Views) Lecture 18 (Unit testing, Objective-C fun, Internationalization) Assignment: SDK 3.0 Feature (Due 11/04/09) 11/4/09Final Project Prep Videos:Lecture 9a (Loren Bricher on Tweetie) Lecture 11a (How to Build an iPhone App that Doesn’t Suck) Assignment:Final Project (Due 12/2/2009) 11/11/09Final Project Prep Videos:Lecture 13a (From Upstart to Startup to Grownup) Lecture 7a (Publishing to the App Store – PDF only) Assignment:Final Project (Due 12/2/2009) 11/18/09Final Project Prep Assignment:Final Project (Due 12/2/2009) 11/25/09Thanksgiving – Continue Final Projects on your own 12/2/09Demonstrate Final Projects 12/6/09Class Offsite – Sunday (tentative) SEC - Beatler Day COMP 446 / ELEC Week 35
Mechanics Course Website: Course Share: \\comp446.rice.edu\comp446\\comp446.rice.edu\comp446 Website Development using Visual Studio Invitation to Join iPhone Developer Program Still pending for Skyler, Rohan, Hailey iPhone Development via Xcode and Interface Builder All IT supported Macs have tools loaded Keep files on your shared drive or memory stick iMac available via User ID Mac Login: Comp446 Passwords given verbally in class SEC - Beatler Day COMP 446 / ELEC Week 36
Course Web Server Hosted through Login: comp446com0 (zero) Password: same as for other things I will create individual websites for each student by 9/16/09 MS SQL Server 2008 also secured for class Will pass out credentials during SQL class Let me know if you need earlier access SEC - Beatler Day COMP 446 / ELEC Week 37
Apple Speak Strong visions Loyal followings Internally consistent Unique ways to describe standard concepts SEC - Beatler Day COMP 446 / ELEC Week 38
Delegation Lecture 4 has long, confusing discussion on Delegates Scott Cutler method to describe delegates Frameworks contain many classes Implementation of some classes either require or optionally allow customization / user coding. Delegates are a set of methods primarily related to a system class Required methods need to be written to complete class Optional methods have default actions that can be overridden by the programmer. SEC - Beatler Day COMP 446 / ELEC Week 39
Delegation Examples applicationDidFinishLoading applicationWillTerminate // Required method - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; // Optional method, defaults to 1 if not implemented - (NSInteger)numberOfSectionsInTableView:(UITableView *)table; SEC - Beatler Day COMP 446 / ELEC Week 310
Objective-C Terminology ;Every statement ends with a semicolon +Refers to a method on a Class -Refers to a method on an instance of a Class { }Groups Objective-C statements [ ][object method OptionalArgs] ()Casts an object as a certain Class, Also parameters for C functions *Pointer to an object e.g. *stringVar (** = pointer to *???) :Specifies an argument. Also used in definitions SEC - Beatler Day COMP 446 / ELEC Week 311
Objective-C an NSString object or selector. Also many //Comments.Shortcut to get or set a property #Compiler Directives like #import !Not (as in !=) +=Standard C style arithmetic (Also ++, -=, etc) %typed placeholder in formatted strings ==Identity compare SEC - Beatler Day COMP 446 / ELEC Week 312
Objective-C Naming Case Matters!!! LastName is not the same as lastName Tradition has identifiers and methods made of concatenated names with the first name in lower case and the remaining names with an uppercase first letter. Examples: lastName, openFile, initWithObjects Compiler will make some things easier when conventions are followed. SEC - Beatler Day COMP 446 / ELEC Week 313
iVars and Properties Two concepts; often related and often confused iVars are the instance variables. Space is allocated from the heap when instanced allocated. They are associated with that instance of the object (although they can be objects in the own right) Properties are readable and/or writeable attributes of a class instance. They can be set to just set or get an iVar. They also can report or change aspects of the instance (e.g. canVote) Often best to give properties different names from iVars due to visibility scope issues. SEC - Beatler Day COMP 446 / ELEC Week 314
Last Week’s Assignment SEC - Beatler Day COMP 446 / ELEC Week 315
Section 1 - Paths SEC - Beatler Day COMP 446 / ELEC Week 316 void PrintPathInfo(){ 1 - Paths"); NSString path = [path stringByExpandingTildeInPath]; home folder is at NSArray *pathComponents = [path pathComponents]; for (NSString *pathElement in pathComponents){ pathElement);} }//PrintPathInfo
Section 2 - Processes SEC - Beatler Day COMP 446 / ELEC Week 317 void PrintProcessInfo(){ 2 - Processes"); NSString *processName = [[NSProcessInfo processInfo] processName]; int processID = [[NSProcessInfo processInfo] processIdentifier]; Name: Process ID: '%d'",processName, processID); }//PrintProcessInfo
Section 3 - URLs SEC - Beatler Day COMP 446 / ELEC Week 318 void PrintBookmarkInfo(){ 3 - URLs"); NSMutableDictionary *urlDictionary; urlDictionary= [NSMutableDictionary dictionary]; [urlDictionary setObject: [NSURL University"]; [urlDictionary setObject: [NSURL [urlDictionary setObject: [NSURL [urlDictionary setObject: [NSURL on iTunes U"]; [urlDictionary setObject: [NSURL Mall"]; for (id key in urlDictionary) { if ([key { value: key, [urlDictionary objectForKey:key]); } }//PrintBookmarkInfo
Section 4 – Introspection (creation) SEC - Beatler Day COMP 446 / ELEC Week 319 void PrintIntrospectionInfo(){ 4 - Introspection"); NSMutableArray *randomArray; randomArray = [NSMutableArray arrayWithCapacity:8]; [randomArray insertObject: [[NSProcessInfo processInfo] processName] atIndex:0]; [randomArray insertObject:[NSURL atIndex:1]; [randomArray insertObject:[NSString ] atIndex:2]; NSArray *keys nil]; NSArray *objects nil]; NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; [randomArray insertObject:dictionary atIndex:3]; NSMutableString *muString string1"; [randomArray insertObject:muString atIndex:4]; NSString String"; [randomArray insertObject:nonMustring atIndex:5]; [randomArray insertObject:[NSMutableDictionary dictionaryWithCapacity:6] atIndex:6]; [randomArray insertObject:[NSMutableString stringWithCapacity:7] atIndex:7]; [[randomArray objectAtIndex:7]
Section 4 – Introspection (inspect) SEC - Beatler Day COMP 446 / ELEC Week 320 for (NSObject *arrayObject in randomArray){ name: class] description]); Member of NSString: isMemberOfClass:[NSString class]] Kind of NSString: isKindOfClass:[NSString class]] if ([arrayObject to lowercaseString: Yes"); is : description] lowercaseString ]); }else{ to lowercaseString: No"); } } } //PrintIntrospectionInfo
Memory Management Basics (next week) SEC - Beatler Day COMP 446 / ELEC Week 321
Final Project To be determined by end of 9 th week Topic chosen shortly after mid semester break (10/21/09) Spec finished by 11/04/09 This is VERY important. If we do not have a great project definition, the most interesting part of the course will suffer. With a great project, this will be an exciting course. Can be done individually or in pairs Great if your project could have life after the class finishes SEC - Beatler Day COMP 446 / ELEC Week 322
Week 4 Assignments View CS193P Lectures 3 and 4 Slides Available for CS193P debugging lecture (Section-1-XCodeDebugging + exercises) Download and complete CS193P Assignments 2a and 2b 2a – Add a Polygon model to your What-A-Tool project 2b – First part of your HelloPolly iPhone Application Use 2b Walkthrough to complete assignment 2b Contact me BEFORE Tuesday if you request my assistance. Complete assignments before next class (9/16/2009)) Note: On LogMeIn, Control Drag does not work as if you were local Introduction to ASP.Net: Future Feel free to get ahead of plan with videos and published assignments Workload will get harder with each assignment. We will follow CS193P assignments up to and including Presence 2 Start thinking about big project Really – start thinking about big project! SEC - Beatler Day COMP 446 / ELEC Week 323