EEC-492/693/793 iPhone Application Development

Slides:



Advertisements
Similar presentations
View-Based Application Development Lecture 1 1. Flows of Lecture 1 Before Lab Introduction to the Game to be developed in this workshop Comparison between.
Advertisements

IOS and AddressBook CS4521. Address Book UI Framework Exploring Contacts.
IPhone – Walkthrough By: Hector M Lugo-Cordero, MS Saad A Khan, MS EEL
View Controllers (second part) Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
HOW TO USE INIGO. Hello, My Name Is Inigo… Lets walk through how to set up your company with Inigo. You will set up a business card on your phone serving.
iOS components in Swift
Mobile Application Development using Android Lecture 2.
CS378 - Mobile Computing Intents.
1 EEC-492/592 Kinect Application Development Lecture 2 Wenbing Zhao
Basic User Guide to Outlook. Info: Manage account settings, create automatic replies to s, clean up your mailbox, and create Rules and Alerts Print:
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
View Controllers Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
Introduction to Objective-C and Xcode (Part 5) FA 175 Intro to Mobile App Development.
 Facebook Integration on iOS Phan Thanh Phat Huynh Thanh Van.
Course Summary Xcode & iPhone Simulator
Sounds, Images, and Text FA 172 Intro to Mobile App Development.
The Controller in MVC of iOS CS4521. The controller in the MVC  Controller  Knows about model and view objects  The brains of the operation  Manages.
Mobile Apps Programming Chin-Sung Lin Eleanor Roosevelt High School.
Persistence CS 344 Mobile App Development Robert Muller.
1 UI Alert View iPhone/iPad, iOS Development Tutorial.
The iOS Platform and SDK. iOS iPhoneiPad Mini iPad.
2/20/2016 EEC492/693/793 - iPhone Application Development 12/20/2016 EEC492/693/793 - iPhone Application Development 1 EEC-492/693/793 iPhone Application.
Lindsey Velez, Director of Instructional Technology Single Sign-On One Click.
1 디바이스 정보  UIDevice 클래스가 제공하고 static 메서드인 currentDevice 가 객체를 생성합 니다.  제공하는 정보 uniqueIdentifier: 장치 고유 ID / 회원가입을 하지 않고 어플을 운영 가능 model: 모델명 systemVersion:
IOS Applications Michelle Alexander COMS E6998 2/4/2013.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Course Summary Xcode & iPhone Simulator
Android Application -Architecture.
IOS Design Patterns Sisoft Technologies Pvt Ltd
Always Connected introduces Tigo SMART 3.0 This guide is interactive!
Notification Sisoft Technologies Pvt Ltd
iOS - First Application Anatomy
Media Library Sisoft Technologies Pvt Ltd
EEC-693/793 Applied Computer Vision with Depth Cameras
EEC-693/793 Applied Computer Vision with Depth Cameras
Windows Phone 7 advanced services
CIS 470 Mobile App Development
IOS App Development.
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
intro to notifications in iOS 10
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
EEC-693/793 Applied Computer Vision with Depth Cameras
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
First, use our API Builder at www. apilinkbuilder
Using K2 applications How can users interact with K2 applications?
EEC-492/693/793 iPhone Application Development
Application Development A Tutorial Driven Course
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
Android Topics UI Thread and Limited processing resources
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
Android App Development Course
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
EEC-492/693/793 iPhone Application Development
Zimmertwins.com Web 2.0 tool
Zimmertwins.com Web 2.0 tool
EEC-492/693/793 iPhone Application Development
Android Development Tools
CSC 581: Mobile App Development
Interactive Media Technology
UI Elements 2.
Microsoft Teams User Interface
Presentation transcript:

EEC-492/693/793 iPhone Application Development Lecture 21 Wenbing Zhao & Nigamanth Sridhar 4/11/2019 4/11/2019 EEC492/693/793 - iPhone Application Development EEC492/693/793 - iPhone Application Development 1

Outline Accessing build-in applications Assignment: Build the Email and PhotoLibrary apps 4/11/2019 4/11/2019 EEC492/693/793 - iPhone Application Development EEC492/693/793 - iPhone Application Development 2

Invoking Build-in Applications [[UIApplication sharedApplication] openURL:url] Email: NSString *emailString = @”mailto:?to=user@email.com&subject=Subject&body=Body”; url = [NSURL URLWithString:emailString]; Safari: url = [NSURL URLWithString: @”http://www.apple.com”]; Phone: url = [NSURL URLWithString: @”tel:96924065”]; SMS: url = [NSURL URLWithString: @”sms:96924065”]; Drawback: calling app will be put to background, user must manually switch back to the app 4/11/2019 EEC492/693/793 - iPhone Application Development

Invoking the Build-in App without Leaving the Current App Invoking the Mail composer UI Use MFMailComposeViewController Invoking the Message composer UI Use MFMessageComposeViewController -(IBAction) btnComposeEmail: (id) sender { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@”Email subject here”]; [picker setMessageBody:@”Email body here” isHTML:NO]; [self presentModalViewController:picker animated:YES]; [picker release]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [controller dismissModalViewControllerAnimated:YES]; 4/11/2019 EEC492/693/793 - iPhone Application Development

The Image Picker Interface UIImagePickerController Handles all user and device interactions UIViewController subclass UIImagePickerControllerDelegate Implemented by your delegate object Steps for using the image picker Check the source availability: isSourceTypeAvailable: class method Assign a delegate object Present the controller modally 4/11/2019 EEC492/693/793 - iPhone Application Development

Displaying the Image Picker Called from a view controller if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController* picker = [[UIImagePickerController alloc] init]; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.delegate = self; // picker.allowsEditing = YES; [self presentModalViewController:picker animated:YES]; } enum { UIImagePickerControllerSourceTypePhotoLibrary, UIImagePickerControllerSourceTypeCamera, UIImagePickerControllerSourceTypeSavedPhotosAlbum }; typedef NSUInteger UIImagePickerControllerSourceType; 4/11/2019 EEC492/693/793 - iPhone Application Development

Defining Your Delegate Object Accept case - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { // Check media type, and save or use the media here [self dismissModalViewControllerAnimated:YES]; // Dismiss the image picker [picker release]; } Cancel case - (void)imagePickerControllerDidCancel: (UIImagePickerController*)picker // Dismiss the image picker. [self dismissModalViewControllerAnimated:YES]; 4/11/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development More on the Accept Case If an image was picked, a dictionary containing the image is passed in If a movie was picked, a filesystem URL for the movie is passed in - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image; NSURL *mediaUrl = (NSURL *)[info valueForKey:UIImagePickerControllerMediaURL]; if (mediaUrl == nil) { image = (UIImage *) [info valueForKey:UIImagePickerControllerEditedImage]; if (image == nil) { //---original image selected--- image = (UIImage *) [info valueForKey:UIImagePickerControllerOriginalImage]; //---display the image--- } else //---edited image picked--- { // handle the image here else { //---video picked--- 4/11/2019 EEC492/693/793 - iPhone Application Development

Accessing the Videos in the Photo Library Specify media types before launch the image picker (default is image only) NSArray *mediaTypes = [NSArray arrayWithObjects:kUTTypeImage, kUTTypeMovie, nil]; imagePicker.mediaTypes = mediaTypes; To play the video picked (works only in ios 4) #import <MediaPlayer/MediaPlayer.h> #import <MobileCoreServices/MobileCoreServices.h> MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:mediaUrl]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:player]; //---play partial screen--- player.view.frame = CGRectMake(0, 0, 320, 460); [self.view addSubview:player.view]; [player play]; 4/11/2019 EEC492/693/793 - iPhone Application Development

Accessing the Videos in the Photo Library Cleaning up when video is done playing - (void) movieFinishedCallback:(NSNotification*) aNotification { MPMoviePlayerController *player = [aNotification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player]; [player.view removeFromSuperview]; [player autorelease]; } 4/11/2019 EEC492/693/793 - iPhone Application Development