The iOS Platform and SDK. iOS iPhoneiPad Mini iPad.

Slides:



Advertisements
Similar presentations
Lecture 2 - Introduction Objective C is used primarily for application development on Apple's Mac OS X and iPhone. On the Apple it is used together with.
Advertisements

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.
Chapter 1: Voilà! Meet the Android
Introduction to Objective-C and Xcode (Part 1) FA 175 Intro to Mobile App Development.
UFCFX5-15-3Mobile Device Development iOS Development Framework.
Anatomy of an iPhone Application Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
View Controllers (second part) Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
IPhone Development Crash Course By Dylan Harris
IPhone Development JaxCodeCamp Who am I David Fekke.NET Developer, ColdFusion Work at LPS Presenter JaxDug, JaxJug, JSUG & JaxFusion Mac User 1986.
IStarted- And You Can Too! A Beginner’s Guide to iOS Programming.
Exploring the iPhone SDK Toyin Adedokun & Daniel Laughlin.
Friday, August 29, 2014 CSCI 351 – Mobile Applications Development.
3-Jul-15 Chapter 2 iPhone App Store and App Business Issues.
UFCFX5-15-3Mobile Device Development iOS Development Review.
Storyboards Managing multiple views. Overview Create a single view application Give the project a name and click “Use Storyboards” and “Use Automatic.
Technical Workshops | Esri International User Conference San Diego, California Deploying your Smartphone and Tablet Apps Eric Ito David Cardella
1 CGS1060 Mobile UIs Copyright 2012 by Janson Industries.
UFCFX5-15-3Mobile Device Development UFCFX Mobile Device Development An Introduction to the Module.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
IOS WorkShoP Xcode 4 iOS 5 : “A Primer”. Objective-C iOS applications are written in Objective-C language using the Cocoa Touch library Objective-C is.
Xcode Presentation Tom Pletzke. Creating App from template Launch Xcode Select Tabbed Application.
Title slide to be used at the start of a module. Developing Mobile Apps Roland Guijt
Chapter 1: Voilà! Meet the Android
FINAL PRESENTATION SYDNEY TOUR. Divya Nalla Raja Kandasamy RajaShekar Donti Ren Zhu Sadah Omar Sulaiman
Object Oriented Programming
Introduction to Mobile Programming. Slide 2 Overview Fundamentally, it all works the same way You get the SDK for the device (Droid, Windows, Apple) You.
1 1 iOS - iPhone/iPad Application Development Workshop Part 1.
DUE Hello World on the Android Platform.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
OS X Development Tom Schroeder. Table of Contents Who cares? HistoryObjective-CCocoaEnvironmentDesign.
Objective-C First Part adapted from a presentation by Kevin Layer.
1 Designing with a UIToolBar iPhone/iPad, iOS Development Tutorial.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Folio3 IPhone Training Session 1 Presenter: Imam Raza.
Mobile Device Programming
Creating “Apps” with your students. iPod/iPhone Pro Very clean interface Touch implementation fairly easy to implement Recognized Con Cost  Hardware.
Tabbed Views UITabBarController. Controller Architecture UITabBarController Controls the first view that the user sees The view controller class (and.
Navigation in iPads splitViewController. Overview Create a Master-Detail application Switch Device Family to iPad Give the project a name and click “Use.
IOS with Swift Hello world app.
Develop iphone application Using Xcode and User Interface Design Ruimin Cai 2011.Sept.22.
Using Xcode A Beginner’s Tutorial Erin Green. This tutorial will walk you through Xcode, a software development tool for Apple’s iOS applications – We.
View Controllers Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
Monday, August 31, 2015 CSCI 351 – Mobile Applications Development.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Last Lecture objective C memory management rules Wrote our first iPhone app a quiz app xib and nib files and interface editor MVC pattern IBOutlet IBAction.
Course Summary Xcode & iPhone Simulator
Nav Controllers UINavigationController. Overview Nav Controller basics Like a tabview controller, a navViewController manages views A navigationViewController.
Orientation Configuration adapting to orientation changes.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Monday, August 31, 2012 CSCI 333 – Systems Programming.
Introduction to Objective-C Spring Goals An introduction to Objective-C As implemented by the Apple LLVM Compiler 4.0 (a.k.a. Clang) Only the basics…
TODAY Android Studio Installation Getting started Creating your 1 st App Beginning to understanding Intents.
Folio3 IPhone Training Session 2 Testing App on device Presenter: Imam Raza.
Inspiration  Christine Love  Digital: A Love Story  Don’t Take It Personally Babe.
Build Cross-Platform Mobile Apps Using Visual Studio A Telerik webinar by Jeffrey T. Fritz March 27, 2014 AND.
Guide To Develop Mobile Apps With Titanium. Agenda Overview Installation of Platform SDKs Pros of Appcelerator Titanium Cons of Appcelerator Titanium.
iOS - iPhone/iPad Application Development Workshop Part 1
Development Environment
CSCI 351 – Mobile Applications Development
iOS - First Application Anatomy
Android Studio, Android System Basics and Git
SOFTWARE DEVELOPMENT KIT-ios and Blackberry
iOS Development Framework
Designing with Introspection
CSCI 351 – Mobile Applications Development
EEC-492/693/793 iPhone Application Development
CSC 581: Mobile App Development
EEC-492/693/793 iPhone Application Development
Apple Xcode with Swift Demo
EEC-492/693/793 iPhone Application Development
Presentation transcript:

The iOS Platform and SDK

iOS iPhoneiPad Mini iPad

Market share Market Share 2012 Second mobile OS in usage First mobile OS in revenue First mobile OS in internet traffic

+ Highest revenue for mobile OS + Little fragmentation (just iPhone and iPad) + Runs on high-end devices + Big developer community and excellent support + Many open-source libraries available - Strictly controlled by Apple - Development only possible in Mac OS - Objective C is the main programming language iOS: Advantages and disadvantages

Technology Application development in Objective C – a language that adds Smalltalk-style messaging to C Development done in Xcode on Mac OS devices Debugging and running on phone done also in Xcode

Installing development kit Install Xcode IDE – newest version Installing Xcode automatically installs iOS SDK Xcode is free to download from Mac App store

Apple developer program Apple developer account is free Apple developer program is not free – 99$/year Registration done from Registration process takes 3-5 days

iOS development 1010 Develop No cost Debug Potential cost 1010 Deploy Requires Developer Program Test Requires Developer Program

iOS debugging 1010 Develop 1010 Simulator does not require a developer program Debug 1010 Device requires a Developer Provisioning Profile – 99$/year

App Store / Marketplace summary iOSAndroidWindows Phone Approval ProcessYesNoYes Distribution outside the storeNoYesNo FragmentationVery LittleYes Multiple stores / MarketplacesNoYesNo

Objective-C is an object oriented language Follows ANSI C style coding with methods from Smalltalk Flexible because almost everything is done at runtime: Dynamic Binding Dynamic Typing Dynamic Linking It is used for both iOS and Mac OS development Source files:.m, header files:.h Has protocols, which work like interfaces in Java they specify a number of methods a class must implement Objective C

Almost every object manipulation is done by sending objects a message Two words within a set of brackets, the object identifier and the message to send: [self.mainLabel setText:[self.mainTextInput text]]; Dot syntax: self.mainLabel.text = self.mainTextInput.text; Equivalent to C++ or Java’s: this.mainLabel.setText( this.mainTextInput.text() ); Static methods start with +, instance methods with -: +(id)defaultController vs. -(void)initLocationManager Messages

A collection of libraries developed by Apple to aid GUI development Has a set of predefined classes and types such as NSNumber, NSString, NSDate (NS stands for NeXT-sun) Includes a root class NSObject where keywords like alloc, retain, and release come from Apple Human Interface Guidelines: ience/Conceptual/MobileHIG/Introduction/Introduction.html ience/Conceptual/MobileHIG/Introduction/Introduction.html Cocoa API

Objects are created dynamically using alloc keyword Objects are automatically deallocated in latest Objective- C through automatic reference counting (ARC) ARC keeps an internal count of how many times an Object is 'needed' System makes sure that objects that are needed are not deleted, and when an object is not needed it is deleted Memory allocation

C++ vs. Objective-C C++Objective C Adds OOP, metaprogramming and generic programming to C Only adds OOP to C Comes with a std libraryHas no standard library; is dependant on other libraries Has numerous usesMostly used for application building Large and complex code for OOPSimpler way of handling classes and objects

Hello world example

Hello World Task: “Change a label’s text using a button and an input box.” Create a new empty project:

New Project Name the project and check “Use Core Data” and “User Automatic Reference Counting”

New Project Create the project and also create local git repository for source control

Create interface Create a new storyboard file Empty storyboard will be created

Creating main screen Click on the storyboard Create a navigation controller from the storyboard designer by drag and drop

Delete default screen Delete the default Table View Controller and add your own View Controller by drag and drop Right click from the navigation controller to View Controller and choose root view controller relationship

Add items to screen Add items to screen by using drag and drop: label, button and text edit Attention! Disable “Use Autolayout” from View Controller properties if you want application to work in iOS 5 and earlier

Create a class for the screen The class should subclass UiViewController

Connect your class to the storyboard Make the View Controller in the storyboard to be you class Open Assistant editor Drag and drop interface objects to you class h file to create connections

Add an action to the button Right click on the button Choose “Touch Up Inside” and drag and drop to the h file Name the method that will be executed when button is touched

Add an action to the button Name the method that will be executed when button is touched

Header file will look like this: MainViewController : (strong, nonatomic) IBOutlet UIButton (strong, nonatomic) IBOutlet UITextField (strong, nonatomic) IBOutlet UILabel *mainLabel; - Change label text: - (IBAction)changeLabel:(id)sender { // Change the text [self.mainLabel setText:[self.mainTextInput text]]; } Source files

Prepare application - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } Delete the gray bold text from didFinishLaunchingWithOptions Go to the auto-generated AppDelegate file and include your own Ui class

Run the application Go to project properties and set your storyboard as Main Storyboard Press run in simulator

Run the application on phone Open the organizer Log in with your developer id You need to be enroller in developer program Connect the phone to the computer Add the device to your provisioning portal

Maps and location

Include CoreLocation and MapKit Go to your project properties, libraries and press to add CoreLocation and MapKit for location and map support By default, they are not added to your project

Adding a Map View Add a Map View to you main screen from the designer

Displaying location on the map Check “Shows User Location” from Map View properties Run the application

- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id ) annotation{ MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation annView.pinColor = MKPinAnnotationColorGreen; annView.animatesDrop=YES; annView.showsCallout=YES; return annView; } Show a pin on the map Make your view controller implement MKAnnotation protocol and implement viewForAnnotation method

@interface LocationController : NSObject // Class members: Location manager and current location (nonatomic, retain) CLLocationManager (nonatomic, retain) CLLocation *currentLocation; + (id)defaultController; // Static singleton // Init, start and stop Location Manager - (void) initLocationManager; - (void) startLocationManager:(CLLocationAccuracy)accuracy; - (void) Handling location Create a class which implements CLLocationManagerDelegate protocol and has a CLLocationManager object Header file: