290 likes | 407 Views
Wednesday 2-4, HZ 122. 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 cutler@rice.edu 9/08/10. Today’s Agenda. Events of the week
E N D
Wednesday 2-4, HZ 122 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 cutler@rice.edu 9/08/10
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/14/2010 COMP 446 / ELEC 446 - Week 3
Events of the Week (1) • Roundup: Apple's fall surprises • Apple Ping Hit by Spammers • Hurdreplaces Phillips as Oracle co-president • HP suing former CEO Mark Hurd • iPad competitors lining up • Galaxy Tab Slated for Launch on Verizon • Toshiba debuts Android-powered Folio 100 tablet • Clearwire Debuts Rover 4G Pay-as-You-Go Mobile Broadband • Windows Phone 7 Released to Manufacturing • Have US wireless carriers gone mad? Samsung Fascinate crippled by Verizon • Android to control half of smartphone market, say analysts COMP 446 / ELEC 446 - Week 3
Events of the Week (2) • iOSusage surpasses Linux - by a whisker • Samsung mulls Android OS for future TVs • Google, AOL Add Mobile, Video with Search Deal • Gmail Logs 10M Calls in First Week • Texas opens antitrust investigation of Google • Ask Maggie: On buggy Android upgrades • AT&T: Net rules must allow 'paid prioritization' • FCC Delays Net Neutrality Decision • Swypekeyboard comes to Symbian, should rock the N8 soon • First Intel Sandy Bridge quad-core benchmarks: Nearly as fast as Core i7 980X • iPad Shipping in 24 Hours, Suggesting Increased Capacity COMP 446 / ELEC 446 - Week 3
Current Roster • Julia Botev • COMP, SR, McMurtryJulia.K.Botev@rice.edu • Eric Cheng • COMP, GR eric.cheng@rice.edu • Jesus Cortez • COMP, JR, Jones JesusCortez@rice.edu • Graham De Wit • ELEC, SR, Wiessgraham.dewit@rice.edu • Ashley Herron • ELEC, SR, Martel Ashley.N.Herron@rice.edu • Tara Hong • ELEC, SR, Will Rice Seoyeon.Hong@rice.edu • Vic Hu • ELEC, SR, Wiessmrwho@rice.edu • Marcos Hung • BIOE, GR Marcos.G.Hung@rice.edu COMP 446 / ELEC 446 - Week 2
Current Roster (2) • Jin Kim • COMP, GR Kyujin.Kim@rice.edu • Kevin Lin • COMP, SO, McMurtryKevin.S.Lin@rice.edu • Robyn Moscowitz • COMP, JR, McMurtryRobyn.A.Moscowitz@rice.edu • Norman Pai • ELEC, SR, HanszenNorman.L.Pai@rice.edu • Josh Rykowski • COMP, GR Joshua.Rykowski@rice.edu • Ivan Van • COMP, SR, Will Rice, i.van@rice.edu • Jeff Yeh • ELEC, SR, Hanszenjeff.yeh@rice.edu • Aron Yu • ELEC, SR, HanszenAron.Yo@rice.edu COMP 446 / ELEC 446 - Week 2
Current Roster (3) • Michael Lo • ELEC, GR mlo@rice.edu • Elliot Ng • ELEC, GR elliottng@rice.edu • Rick Manning • COMP, SR, Jones rick.manning@rice.edu • Henry Zhang • ELEC, SR, Jones qz1@rice.edu • Jason Xu • ELEC, SR, Brown jax1@rice.edu • Catherine Elder • ELEC, SR, Hanszencje1@rice.edu COMP 446 / ELEC 446 - Week 2
Current Roster (4) • Sid Byrd • Staff sidb@rice.edu • Xiang ‘Jash’ Guo • ELEC, GR xg1@rice.edu • Qing Cao • ELEC, GR qc4@rice.edu • Wenyang Wu • CS, GR ww7@rice.edu • ZheRen • CS, GR zr2@rice.edu COMP 446 / ELEC 446 - Week 2
COMP 446 (tentative) Syllabus • 8/25/10 Introduction / What makes mobile apps special • Assignment: Load Visual Studio – Due 8/30/10, Access a Mac, Download CS193P materials • 9/1/10 Intro to Mac OS X and Cocoa Touch, Objective-C, Dev Tools, Using Objective-C, Foundation framework • Videos: Lecture 1. Introduction to Mac OS X, Cocoa Touch, Objective-C and Tools (January 5, 2010) Lecture 2. Objective-C and Foundation Framework (January 7, 2010) • Assignment: Hello Rice [1a] and WhatATool 1 [1b] (Due 9/7/10) • 9/8/10 Discussion of first applications • Videos: Lecture 3. Custom Classes, Object Lifecycle, Autorelease, Objective-C Properties (January 12, 2010)Lecture 4. Building an Application; Model, View, Controller; Nib Files; Controls and Target-Action (January 14, 2010) Lecture 4a Xcode, Finding Help, Debugging (January 15, 2010) • Assignment: WhatATool 2 [2a] and HelloPoly I [2b] (Due 9/14/10) • 9/15/10 ASP.Net with a little HTML • Videos: Lecture 5. Views, Drawing, and Animation (January 19, 2010) Lecture 6. Designing iPhone Applications, Model-View-Controller, View Controllers (January 21, 2010) • Assignment: HelloPoly II [3] (Due 9/21/10) • 9/22/10 iPhone (pseudo) Web Apps / Browser Capabilities • Videos: Lecture 7. Navigation & Tab Bar Controllers (January 26, 2010) Lecture 8. Scroll Views and Table Views (January 28, 2010) • Assignment: Paparazzi 1 (Due 9/28/10) • 9/29/10 Creating and Consuming Web Services • Videos: Lecture 9. Data in Your iPhone App (February 2, 2010)- Lecture 10. Performance (February 4, 2010) • Assignment: Paparazzi 2 (Due 10/05/10) • 10/6/10 SQL 101 • Videos: Lecture 11. Text Input and Presenting Content Modally (February 9, 2010) Lecture 12. Web Views; Locations and Maps (February 11, 2010) • Assignment: Paparazzi 3 (Due 10/19/10, but watch lectures prior to 10/13/10 class) COMP 446 / ELEC 446 - Week 2
COMP 446 (tentative) Syllabus • 10/13/10iPad Development / iOS 4 • Videos:Lecture 13. Address Book: Putting People in Your App (February 16, 2010) Lecture 14. Touch Events & Multi-touch (February 18, 2010)Lecture 12a: Designing for the iPad (February 12, 2010)Assignment: Final Project Proposal (Due 10/19/10 along with Paparazzi 3) • 10/20/10 Android 1 • Videos: Lecture 15. iPhone Device APIs; Location, Accelerometer & Camera; Battery Life & Power Management (February 23, 2010) Lecture 16. Audio APIs, Video Playback, Settings (February 25, 2010) • Assignment: Final Project, Stage 1 (Due 10/26/10) • 10/27/10 Android 2 • Videos: Lecture 17. Bonjour, NSStream, GameKit (March 2, 2010) Lecture 18. Unit Testing; Fun with Objective-C; Localization (March 4, 2010) • Assignment: Advanced Feature App or iPad Application (Due 11/02/10) • 11/3/10 Windows Phone 7, Final Project Prep • Videos: Lecture 19. OpenGL ES Basics (March 9, 2010)Lecture 20. From Student to Startup: Lessons from a CS193P Alumnus (March 11, 2010) • Assignment: Final Project, Stage 2 (Due 11/09/2010) • 11/10/10 iPhone v. Android v. Windows Phone 7 group discussion • Videos: Yelp Monocle (February 6, 2010) Evernote(February 19, 2010) Bump (February 26, 2010) • Assignment: Final Project, Stage 3 (Due 11/16/2010) • 11/17/10 Final Project Prep • Videos: Publishing on the App Store (March 5, 2010) LinkedIn: Important Life Lessons on CoreData & GameKit (March 12, 2010) • Assignment: Final Project (Due 12/01/2010) • 11/24/10 Thanksgiving – Continue Final Projects on your own • 12/1/10 Demonstrate Final Projects • 12/5/10 Class Offsite – Sunday (tentative) COMP 446 / ELEC 446 - Week 2
Mechanics • Course Website: http://www.comp446.com • Assignments submitted through website in the form of a compressed directory unless otherwise noted. • Invitation to Join iPhone Developer Program • Still pending for Qing Cao • iPhone Development via Xcode and Interface Builder • All IT supported Macs have tools loaded • Keep files on your shared drive or memory stick • Use xcode:xcode to access debugger • Mac Minis available via www.LogMeIn.com • User ID comp446@scottcutler.com • Mac Login: Comp446 • Passwords given verbally in class COMP 446 / ELEC 446 - Week 3
Course Web Server • http://www.comp446.com • Hosted through www.DiscountASP.net • Website will be created for students on demand based on interest and need for final project • MS SQL Server 2008 also secured for class • Credentials will be given to students who need to use it for their final projects COMP 446 / ELEC 446 - Week 3
Phone Availability • Some phones will be available for final projects. • Wi-Fi only unless you add them to your plan. • Hardware: • 1 x iPhone 3GS (AT&T) • 1 x iPhone 3G (AT&T) • 1 x iPhone Original (AT&T) • 4 x Motorola Droids (Verizon) (Donated by Google) • 1 x Google Nexus One (T-Mobile) • Note that the iPhones and Nexus One are my personal phones. COMP 446 / ELEC 446 - Week 3
Apple Speak • Strong visions • Loyal followings • Internally consistent • Unique ways to describe standard concepts • Remember: It is a religion! • Two interesting short videos: • http://www.youtube.com/watch?v=0FW-lrMXLBE • http://www.youtube.com/watch?v=1ZS8HqOGTbA COMP 446 / ELEC 446 - Week 3
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. COMP 446 / ELEC 446 - Week 3
Delegation Examples • applicationDidFinishLoading • applicationWillTerminate • // Some are required methods- (NSInteger)tableView:(UITableView *)tableViewnumberOfRowsInSection:(NSInteger)section; • // Some are optional methods, • this one defaults to 1 if not implemented - (NSInteger)numberOfSectionsInTableView:(UITableView *)table; COMP 446 / ELEC 446 - Week 3
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 COMP 446 / ELEC 446 - Week 3
Objective-C Terminology @ Prefaces an NSString object or selector. Also many compiler directives (@Interface, @Implementation, @End // 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 COMP 446 / ELEC 446 - Week 3
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. COMP 446 / ELEC 446 - Week 3
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 their 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. COMP 446 / ELEC 446 - Week 3
Last Week’s Assignment COMP 446 / ELEC 446 - Week 3
Section 1 - Paths voidPrintPathInfo(){ NSLog(@"Section 1 - Paths"); NSString *path=@"~"; path = [path stringByExpandingTildeInPath]; NSLog(@"My home folder is at '%@'",path); NSArray *pathComponents = [path pathComponents]; for (NSString *pathElementinpathComponents){ NSLog(@"%@", pathElement);} }//PrintPathInfo COMP 446 / ELEC 446 - Week 3
Section 2 - Processes voidPrintProcessInfo(){ NSLog(@"Section 2 - Processes"); NSString *processName = [[NSProcessInfoprocessInfo] processName]; intprocessID = [[NSProcessInfoprocessInfo] processIdentifier]; NSLog(@"Process Name: '%@' Process ID: '%d'",processName, processID); }//PrintProcessInfo COMP 446 / ELEC 446 - Week 3
Section 3 - URLs voidPrintBookmarkInfo(){ NSLog(@"Section 3 - URLs"); NSMutableDictionary *urlDictionary; urlDictionary= [NSMutableDictionary dictionary]; [urlDictionarysetObject: [NSURL URLWithString:@"http://www.stanford.edu"] forKey: @"Stanford University"]; [urlDictionarysetObject: [NSURL URLWithString:@"http://www.apple.com"] forKey: @"Apple"]; [urlDictionarysetObject: [NSURL URLWithString:@"http://cs193p.stanford.edu"] forKey: @"CS193P"]; [urlDictionarysetObject: [NSURL URLWithString:@"http://itunes.stanford.edu"] forKey: @"Stanford on iTunes U"]; [urlDictionarysetObject: [NSURL URLWithString:@"http://stanfordshop.com"] forKey: @"Stanford Mall"]; for (id key inurlDictionary) { if ([key hasPrefix:@"Stanford"]) { NSLog(@"key: %@, value: %@", key, [urlDictionaryobjectForKey:key]); } } }//PrintBookmarkInfo COMP 446 / ELEC 446 - Week 3
Section 4 – Introspection (creation) voidPrintIntrospectionInfo(){ NSLog(@"Section 4 - Introspection"); NSMutableArray *randomArray; randomArray = [NSMutableArray arrayWithCapacity:8]; [randomArrayinsertObject: [[NSProcessInfoprocessInfo] processName] atIndex:0]; [randomArrayinsertObject:[NSURL URLWithString:@"http://www.stanford.edu"] atIndex:1]; [randomArrayinsertObject:[NSStringlocalizedStringWithFormat:@"%@: %f\n", @"Cost", 1234.56] atIndex:2]; NSArray *keys = [NSArrayarrayWithObjects:@"key1", @"key2", @"key3", nil]; NSArray *objects = [NSArrayarrayWithObjects:@"value1", @"value2", @"value3", nil]; COMP 446 / ELEC 446 - Week 3
Section 4 – Introspection (creation) NSDictionary *dictionary = [NSDictionarydictionaryWithObjects:objectsforKeys:keys]; [randomArrayinsertObject:dictionary atIndex:3]; NSMutableString *muString = [NSMutableStringsetString:@"mutable string1“]; [randomArrayinsertObject:muString atIndex:4]; NSString *nonMustring=@"Plain String"; [randomArrayinsertObject:nonMustring atIndex:5]; [randomArrayinsertObject:[NSMutableDictionary dictionaryWithCapacity:6] atIndex:6]; [randomArrayinsertObject:[NSMutableString stringWithCapacity:7] atIndex:7]; [[randomArray objectAtIndex:7] appendString: @"Help"]; COMP 446 / ELEC 446 - Week 3
Section 4 – Introspection (inspect) for (NSObject *arrayObjectinrandomArray){ NSLog(@"Class name: %@",[[arrayObject class] description]); NSLog(@"Is Member of NSString: %@",[arrayObjectisMemberOfClass:[NSString class]] ? @"YES" : @"NO"); NSLog(@"Is Kind of NSString: %@",[arrayObjectisKindOfClass:[NSString class]] ? @"YES" : @"NO"); if ([arrayObjectrespondsToSelector:@selector(lowercaseString)]){ NSLog(@"Responds to lowercaseString: Yes"); NSLog(@"lowercaseString is : %@",[[arrayObject description] lowercaseString ]); }else{ NSLog(@"Responds to lowercaseString: No"); } NSLog(@"===================================="); } } //PrintIntrospectionInfo COMP 446 / ELEC 446 - Week 3
Final Project • To be determined by end of 9th week • Topic chosen shortly after mid semester break (10/19/10) • Spec finished by 10/26/10 • 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 COMP 446 / ELEC 446 - Week 3
Week 4 • Assignments • View CS193P Lectures 3 and 4, 4a (Xcode, Finding Help, Debugging (1/15) • 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 or Richard Latimerif you need our assistance. • Complete assignments by end of day Tuesday (9/14/2010) • Note: On LogMeIn, Control Drag does not work as if you were local • Introduction to ASP.Net and html • Future • Feel free to get ahead of plan with videos and assignments • Projects will get harder with each assignment, but you will be spending less time on the mechanics of using Xcode, etc. • We will follow CS193P assignments up to and including Paparazzi 3 • Start thinking about big project COMP 446 / ELEC 446 - Week 3