1 / 0

Wednesday 2-4, DH 1046

Wednesday 2-4, DH 1046. 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 cutler@rice.edu 10/19/11. Today’s Agenda. Events of the week

kylene
Télécharger la présentation

Wednesday 2-4, DH 1046

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Wednesday 2-4, DH 1046

    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 cutler@rice.edu 10/19/11
  2. Today’s Agenda Events of the week Final Projects iPhone 4S iCloud iOS 5 Apps iOS 5 Internals Next Week COMP 446 / ELEC 446 - Week 9
  3. Events of the Week Apple releases iOS5 iPhone Why iPhone 4S Won't Be as Successful as Expected iPhone 4S goes on sale (live blog) 10 Reasons Not to Buy the iPhone 4S Yet Apple sells 4 million iPhone 4S units in first weekend Dennis Ritchie, father of C programming language, dies Studios, Apple reportedly are in film-access talks CTIA 2011 Microsoft closes $8.5 billion Skype acquisition Google earnings rock in 3rd quarter Despite strength, Apple earnings miss the mark COMP 446 / ELEC 446 - Week 9
  4. COMP 446 Syllabus 8/24/11 Introduction / What makes mobile apps special Videos: Lecture 1. Introduction to Cocoa Touch, Objective-C, Tools, and MVC (September 21, 2010) Lecture 2. Building a Simple Calculator (September 23, 2010) Assignment: #1 and #1 Walkthrough - Calculator Due: Preferably watch videos this week, definitely by 8/30. Assignment due 9/1/11. 8/31/11 Discussion of first applications, Development Environment Videos: Lecture 3. Objective-C and Foundation Frameworks (September 28, 2010) Lecture 4. Foundation and Memory Management (September 30, 2010) Assignment: #2 Function Calculator (Due 9/15/11) 9/7/11 Intro to Cocoa Touch, Objective-C, Using Objective-C, Foundation framework Videos: Assignment: 9/14/11Memory Management Videos: Lecture 5. Protocols and Views (October 5, 2010) Lecture 6. Application & View Controller Lifecycle, Navigation Controller (October 7, 2010) Assignment: #3 Graphing Calculator (Due 9/22/11) 9/21/11 iPhone (pseudo) Web Apps Videos: Lecture 7. More Controllers of Controllers, iPad, Universal Applications (October 12, 2010) Lecture 8. Gesture Recognizers (October 14, 2010) Assignment: #4 Universal Calculator (Due 9/29/11) COMP 446 / ELEC 446 - Week 9
  5. COMP 446 Syllabus 9/28/11 Creating and Consuming Web Services Videos: Lecture 9. Image View, Web View, and Scroll View (October 19, 2010) Lecture 10. Table View (October 21, 2010)Assignment: #5 Pictures Places (Due 10/13/11) 10/5/11 SQL 101 Videos: Lecture 11. Persistence (October 26, 2010) Lecture 12. Core Data and Table Views (October 28, 2010) Assignment: #6 Core Data Places (Due 10/20/11, but watch lectures prior to 10/12/11 class) 10/12/11 Core Data Demo / Final Project discussion and Pairing Videos: Debugging Tools (October 22, 2010)Kleiner Perkins iFund (October 15, 2010) Assignment: Final Project Proposal (Due 10/18/11 along with Core Data Places due 10/20/11) 10/19/11 iOS 5 Videos: Lecture 13. Blocks and Multithreading (November 2, 2010) Lecture 14. Core Location and Map Kit (November 9, 2010) Assignment: Final Project, Stage 1 (Due 10/27/11) 10/26/11 Android Videos: Lecture 15. Editable Text, Modal View Controllers, and View Animation (Nov 11, 2010) Lecture 16. Core Motion, Segmented Control, and Alerts (November 16, 2010) Assignment: Advanced Feature App (Due 11/03/11) COMP 446 / ELEC 446 - Week 9
  6. COMP 446 Syllabus 11/2/11 Windows Phone 7, Final Project Prep Videos: Lecture 17. Media (November 18, 2010) Lecture 18. Accessibility on iOS: Make an App for Everyone (November 30, 2010) Assignment: Final Project, Stage 2 (Due 11/10/2011) 11/09/11 Final Project Prep / iPhone v. Android v. Windows Phone 7 group discussion Videos: Lessons from Bezos, Pincus, Young: CEO 2.0 (November 12, 2010) (Optional) LinkedIn: Shipping with CoreData (November 5, 2010) (Optional) Assignment: Final Project, Stage 3 (Due 11/17/2011) 11/16/11 Final Project Prep – individual/team meetings Videos: Building Flipboard (November 19, 2010) (Optional) Assignment: Final Project Presentation (Due 11/30/2011) 11/23/11 Thanksgiving – Continue Final Projects on your own 11/30/11 Demonstrate Final Projects to class 12/4/11 Class Offsite – Sunday (tentative) Finals Submission of final code due by official finals date COMP 446 / ELEC 446 - Week 9
  7. Final Projects The first half of the course teaches iOS The second half is dominated by final projects You will be staged through the design: Fleshed out spec due next week (10/27) Test app of your most difficult feature due in two weeks (11/03) Status Update due (11/10) Individual meeting instead of (11/16) class No class 11/23 Demonstrate final projects 11/30 Final documentation due at start of class finals time Likely offsite 12/4/11 COMP 446 / ELEC 446 - Week 9
  8. Final Project Spec Similar to a user’s manual Lists operation of app in detail List of frameworks and advanced technologies to be used Include simulated screen shots Hand drawn Interface Builder PowerPoint Think through the logic For team projects, identify responsibilities NOT cast in stone. Some projects may adjust over time. COMP 446 / ELEC 446 - Week 9
  9. Apple’s new stuff COMP 446 / ELEC 446 - Week 9
  10. iCloud iTunes in the Cloud Wireless delivery of new and past music and TV iTunes Match Photo Stream Automatic sharing of pictures to all your devices Documents in the Cloud Keynote, Pages, Numbers and others written for the cloud Apps New apps downloaded to all your devices iBooks All your devices on the same page Calendar / Mail / Contacts All your devices on the same page Backup Daily automatic Wi-Fi backups Find My Friends | Find My iPhone Find youriOS and OSX devices and iOS devices of friends who allow COMP 446 / ELEC 446 - Week 9
  11. iPhone 4S Looks the same, but: Speaks CDMA and GSM – World Phone Better Camera 8mp, 1080p movies, better lens, improved sensor Faster, dual core processor Improved dual antenna Its sounds minor – but enables significant improvements COMP 446 / ELEC 446 - Week 9
  12. iOS 5 Apps Many minor app upgrades Twitter Integration, Camera Enhancements, Photo Albums Hourly forecasts, Browser Tabs, etc. New Apps Notification Center iMessage Reminders Newsstand Mirror Many Features, like notification center influenced by Android Siri COMP 446 / ELEC 446 - Week 9
  13. Siri Voice activated smart personal assistant Web assisted voice recognition Significant, natural language processing Location aware Access to iPhone internals Integrated with Yelp and Wolfram Alpha http://www.apple.com/iphone/features/siri.html COMP 446 / ELEC 446 - Week 9
  14. iOS 5 Internals To maintain app consistency, Apple SDKs expose high level APIs for most application features With new apps and new app features come matching iOS updates Some APIs get deprecated and those already deprecated may move towards extinction. COMP 446 / ELEC 446 - Week 9
  15. iCloud Storage APIs iCloud document storage—Use this feature to store user documents and data in the user’s iCloud account. iCloud key-value data storage—Use this feature to share small amounts of data among instances of your application. COMP 446 / ELEC 446 - Week 9
  16. Automatic Reference Counting Replaces use of retain, release, autorelease and dealloc Limitations like no storage of object pointers in non-objects (c struct). No use of NSAutoreleasePool Change @property (retain) replaced by (strong) (assign) replaced by (weak) Tools exist to help with migration Just as we were getting the hang of it! COMP 446 / ELEC 446 - Week 9
  17. Storyboards Captures entire user interface in one file rather than collection of nib files Xcode support built into template files UIMainStoryboardFile key in Info.plist replacing NSMainNibFile. New methods prepareForSegue:sender: performSegueWithIdentifier:sender instantiateViewControllerWithIdentifier COMP 446 / ELEC 446 - Week 9
  18. Newsstand Support NewsstandKit.framework Newstand apps only appear in Newstand COMP 446 / ELEC 446 - Week 9
  19. AirPlay Improvements Application content directly on AppleTV 2 Mirroring or new UIScreen object Stream content via AVPlayer class UIWebView supports AirPlay Defaults to ON – but app can disable. COMP 446 / ELEC 446 - Week 9
  20. New Frameworks GLKit.framework for OpenGL ES 2.0 CoreImage.framework Filters for manipulating video and still images Twitter.framework Accounts.framework GSS.framework (Generic Security Services) IETF RFC 2743 and RFC 4401 CoreBluetooth.framework Interactions with Bluetooth Low-Energy COMP 446 / ELEC 446 - Week 9
  21. Application Design-Level Improvements UIDocument class reduces work required to manage document data Background reading and writing iCloud support Data Protection Improvements NSFileProtectionCompleteUnlessOpen option NSFileProtectionCompleteUntilFirstUserAuthentication Custom Appearance for UIKit Controls Wrappers for the iPhone. Container View Controller Support Custom Nav, TabView and SplitView controllers Settings Radio group element COMP 446 / ELEC 446 - Week 9
  22. Xcode Tools Xcode 4.2 LLVM compiler supports Automatic Reference Counting Storyboard support Can set location Load and store application data from device OpenGL ES Debugging UI Automation Enhancements Rotate gestures, location changes, control by Instruments, rotate around point, tap sequence Instruments System Trace Network Connection instrument Network Activity (for energy measurement). COMP 446 / ELEC 446 - Week 9
  23. Additional Framework Enhancements Many changes to existing methods New methods to foundation NSJSONSerialization class NSLinguisticTagger NSOrderedSet External Accessory features for sleeping apps Event Kit improvements Core Motion incorporating heading Core Location support for forward/reverse geocoding . . . And the list goes on. COMP 446 / ELEC 446 - Week 9
  24. Assignment #6 Staggered overlapping due date with Assignment #5 Three major parts Core Data version of Assignment #5 Addition of Favorite Places Caching of image data to sandbox Item 1 required, Items 2 and 3 required if you want possibility of A+ in class Do part 1 as if you were doing full assignment Create both Photo and Place entities with proper relationships While not required, if you want to create great apps, you should also do Assignment #7 – multi thread Items 2 and 3 can be submitted at any time before last class WATCH THE DEMO IN VIDEO 12 COMP 446 / ELEC 446 - Week 9
  25. Core Data Demo Not going through this today, but might help #6 Fetch a lost of photos from Flickr Display a table view full of the photographers who took those photos Push a list of that photographer’s photos when the photographer is clicked on Display a photo in a UIScrollView when a photo is clicked on (not in Demo) Basically same demo as in the CS193p video COMP 446 / ELEC 446 - Week 9
  26. Core Data Demo Steps #1 Create new Window Based app (Bugshutter) (Taken from CS193p Shutterbug) Using Core Data Create Photo and Photographer entities Starts off as NSManagedObject. Will be updated when classes written. Photo Attribute – imageURL (String) Photo Attribute – title (string) Photo Attribute – uniqueId (string) Photographer Attribute – name (string) Photographer Relationship – photos, To-Many, Destination Photo, No inverse yet Photo Relationship – whoTook, Destination Photographer, Inverse photos, not Too Many Create custom classes by: Click on one, Create new file of type Managed Object Class, (Editor – Create NSManagedObject Subclass), Select all objects, move into classes Import CoreDataTableViewController and FlickerFetcher (and JSON) Classes (with copy) Make sure recentGeoreferencedPhotos is in FlickrFetcher Add code to get photos from Flickr to AppDelegate Import FlickrFetcher.h, NSArray *photos =[FlickrFetcherrecentGeoreferencedPhotos]; for (NSDictionary *photoInfo in photos){} In Photo.h, add method + (Photo *)photoWithFlickrData:(NSDictionary *)flickrDatainManagedObjectContext:(NSManagedObjectContext *)context; COMP 446 / ELEC 446 - Week 9
  27. Core Data Demo Steps #2 In Photo.m create: + (Photo *)photoWithFlickrData:(NSDictionary *)flickrDatainManagedObjectContext:(NSManagedObjectContext *)context{ Photo *photo=nil;NSFetchRequest *request = [[NSFetchRequestalloc] init];request.entity = [NSEntityDescriptionentityForName:@”Photo” inManagedObjectContext:context];request.predicate = [NSPredicatepredicateWithFormat:@”uniqueId=%@”, [flickrDataobjectForKey:@”id”]];NSError *error = nil; photo = [[context executeFetchRequest:request error:&error] lastObject]; if (!error && !photo) { photo = [NSEntityDescriptioninsertNewObjectForEntityForName:@”Photo” inManagedObjectContext:context];photo.uniqueId = [flickrDataobjectForKey:@”id”];photo.title = [flickrDataobjectForKey:@”title”];photo.imageURL = [FlickrFetcherurlStringForPhotoWithFlickrInfo:flickrDataformat:FlickrFetcherPhotoFormateLarge];photo.whoTook = [Photographer photographerWithFlickrData:flickrDatainManagedObjectContext:context]; } return photo;} #import FlickerFetcher.h and Photographer.h In Photographer.m, copy and past photoWithFlickData code. COMP 446 / ELEC 446 - Week 9
  28. Core Data Demo Steps #3 In Photographer.m, copy and past photoWithFlickData code. + (Photographer*)photographerWithFlickrData:(NSDictionary *)flickrDatainManagedObjectContext:(NSManagedObjectContext *)context{ Photographer *photographer=nil;NSFetchRequest *request = [[NSFetchRequestalloc] init];request.entity = [NSEntityDescriptionentityForName:@”Phototographer” inManagedObjectContext:context];request.predicate = [NSPredicatepredicateWithFormat:@”name=%@”, [flickrDataobjectForKey:@”ownername”]];NSError *error = nil; photographer = [[context executeFetchRequest:request error:&error] lastObject]; if [!error && !photographer) {photographer = [NSEntityDescriptioninsertNewObjectForEntityForName:@”Photographer” inManagedObjectContext:context]; photographer.name = [flickrDataobjectForKey:@”ownername”];photo.title = [flickrDataobjectForKey:@”title”];photo.imageURL = [FlickrFetcherurlStringForPhotoWithFlickrInfo:flickrDataformat:FlickrFetcherPhotoFormateLarge];photo.whoTook=[Photographer photographerWithFlickrData:flickrDatainManagedObjectContext:context]; }return photographer;} In Photographer.h, add: + (Photographer*)photographerWithFlickrData:(NSDictionary *)flickrDatainManagedObjectContext:(NSManagedObjectContext *)context; COMP 446 / ELEC 446 - Week 9
  29. Core Data Demo Steps #4 Back in AppDelegate, add #import “Photo.h” and finish didFinish…. NSArray *photos =[FlickrFetcherrecentGeoreferencedPhotos];for (NSDictionary *photoInfo in photos){Photo *photo = [Photo photoWithFlickrData:photoInfoinManagedObjectContext:self.managedObjectContext];} [self saveContext]; File, new Class PhotographersTableViewController #import “CoreDataTableViewController.h” Subclass of :CoreDataTableViewController - initInManagedObjectContext: (NSManagedObjectContext *)context; COMP 446 / ELEC 446 - Week 9
  30. Core Data Demo Steps #5 PhotographersTableViewController.m - initInManagedObjectContext: (NSManagedObjectContext *)context{ if (self = [super initWithStyle:UITableViewStylePlain]) {NSFetchRequest *request = [[NSFetchRequestalloc] init];request.entity = [NSEntityDescriptionentityForName:@”Photographer” inManagedObjectContext:context];request.sortDescriptors=[NSArrayarrayWithObject:[NSSortDescriptorsortDescriptorWithKey:@”name” ascending:YES]request.predicate = nil;request.fetchBatchSize = 20;NSFetchedResultsController *frc = [[NSFetchedResultsControlleralloc]initWithFetchRequest:requestmanagedObjectContext:contextsectionNameKeyPath: nil cacheName:@”MyPhotoCache”]; [request release];self.fetchedResultsController=frc; [frc release];self.titleKey = @”name”; }return self;} -(void) managedObjectSelected:(NSManagedObject *)managedObject{} COMP 446 / ELEC 446 - Week 9
  31. Core Data Demo Steps #6 Back in AppDelegate, add #import “PhotographersTableViewController.h” and finish didFinish…. NSArray *photos =[FlickrFetcherrecentGeoreferencedPhotos];for (NSDictionary *photoInfo in photos){Photo *photo = [Photo photoWithFlickrData:photoInfoinManagedObjectContext:self.managedObjectContext];} [self saveContext];PhotographersTableViewController *ptvc = [[PhotographersTableViewControlleralloc] initInManagedObjectContext:self.managedObjectContext];UINavigationController *navcon = [[UINavigationControlleralloc] init];[navconpushViewController:ptvcannimated:NO];[self.windowaddSubview:navcon.view];[self.windowmakeKeyAndVisible];return YES; COMP 446 / ELEC 446 - Week 9
  32. Core Data Demo Steps #7 Create PhotosByPhotographerTableViewController Import #”CoreDataTableViewController.h” and “Photographer.h). Subclass CoreTableViewController -initWithPhotographer:(Photographer *)photographer; //(not inManagedObjectContext) Copy and paste from PhotographersTableViewController.m -initWithPhotographer:(Photographer *)photographer{NSManagedObjectContext *context=photographer.managedObjectContext; if (self = [super initWithStyle:UITableViewStylePlain]) {NSFetchRequest *request = [[NSFetchRequestalloc] init];request.entity = [NSEntityDescriptionentityForName:@”Photo” inManagedObjectContext:context];request.sortDescriptors=[NSArrayarrayWithObject:[NSSortDescriptorsortDescriptorWithKey:@”title” ascending:YES]request.predicate = [NSPredicatepredicateWithFormat:@”whoTook=%@”, photographer];request.fetchBatchSize = 20;NSFetchedResultsController *frc = [[NSFetchedResultsControlleralloc]initWithFetchRequest:requestmanagedObjectContext:contextsectionNameKeyPath: nil cacheName:nil];request release];self.fetchedResultsController=frc;[frc release];self.titleKey = @”title”;} -(void) managedObjectSelected:(NSManagedObject *)managedObject{} COMP 446 / ELEC 446 - Week 9
  33. Core Data Demo Steps #8 Back in PhotographersTableViewController.m #import “PhotosByPhotographerTableViewController.h” -(void) managedObjectSelected:(NSManagedObject *)managedObject{ Photographer *photographer = (Photographer *)managedObject;PhotosByPhotographerTableViewController *pbptvc=[[PhotosByPhotographerTableViewControlleralloc] initWithPhotographer:photographer]; [self.navigationControllerpushViewController:pbptvcanimated:YES]; [pbptvc release];} COMP 446 / ELEC 446 - Week 9
  34. Week 10 Final Project Proposals due 10/28/11 Remember that the majority of course grade comes from final project Videos Optional from this point on See Syllabus for Video suggestions Technology – Android COMP 446 / ELEC 446 - Week 9
More Related