ios Application Development &



Similar documents
Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Developing Applications for ios

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Praktikum Entwicklung von Mediensystemen mit

How To Develop An App For Ios (Windows)

Mobile Phones Operating Systems

Android v ios Mobile Operating Systems

MA-WA1920: Enterprise iphone and ipad Programming

Cross-platform mobile development with Visual C

Arduino Training - Basics of Micro-controllers Programming Basics

Penetration Testing for iphone Applications Part 1

INTRODUCTION TO IOS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 13 02/22/2011

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

2. About iphone ios 5 Development Essentials. 5. Joining the Apple ios Developer Program

ios Development Tutorial Nikhil Yadav CSE 40816/60816: Pervasive Health 09/09/2011

INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

CSCI E-65: Mobile Application Development Using Swift and ios

Customize Mobile Apps with MicroStrategy SDK: Custom Security, Plugins, and Extensions

01. Introduction of Android

The story so far: Teaching Mobile App Development at PG level at Londonmet

eggon SDK for ios 7 Integration Instructions

Client Requirement. Master Data Management App. Case Study -

Developing and deploying mobile apps

Introduction to Android

Programming Mobile Apps with Python

How To Use Titanium Studio

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Gathering customer information from a mobile application James Adams, SAS Institute Inc.

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Example of Standard API

Introduction to Programming with Xojo

Practical Android Projects Lucas Jordan Pieter Greyling

Cross-Platform Mobile Apps Solution

Lee Barnes, CTO Utopia Solutions. Utopia Solutions

Discovering Computers

IBM TRIRIGA Anywhere Version 10 Release 4. Installing a development environment

QML and JavaScript for Native App Development

research: technical implemenation

This documentation is made available before final release and is subject to change without notice and comes with no warranty express or implied.

Building Mobile Applications Creating ios applications with jquery Mobile, PhoneGap, and Drupal 7

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

ADITION ios Ad SDK Integration Guide for App Developers

Application Development for Mobile and Ubiquitous Computing

How To Use Ios 5

Workshop on Android and Applications Development

Choosing a Mobile Application Development Approach

geniusport mobility training experts

Lecture 1 Introduction to Android

ios Technology Overview

OS X LION SET UP THE SYSTEM

Cross Platform Mobile. -Vinod Doshi

ipad, a revolutionary device - Apple

iphone Objective-C Exercises

NETGEAR genie Apps. User Manual. 350 East Plumeria Drive San Jose, CA USA. August v1.0

COLLIN COLLEGE COURSE SYLLABUS

City of Dublin Education & Training Board. Programme Module for. Mobile Technologies. leading to. Level 6 FETAC. Mobile Technologies 6N0734

Kony MobileFabric Messaging. Demo App QuickStart Guide. (Building a Sample Application

esarinformation Systems Simplifying your Technology Mobile Applications Development Profile

Adobe Summit 2015 Lab 718: Managing Mobile Apps: A PhoneGap Enterprise Introduction for Marketers

Android Architecture. Alexandra Harrison & Jake Saxton

Introduction to Android

CS378 -Mobile Computing. Android Overview and Android Development Environment

Creating a Custom Class in Xcode

iphone ios 6 Development Essentials

Objective C and iphone App

Take full advantage of IBM s IDEs for end- to- end mobile development

ios Development: Getting Started Min Tsai March 1, 2011 terntek.com v1.0

ios Testing Tools David Lindner Director of Mobile and IoT Security

Colligo Briefcase Enterprise. Administrator s Guide

COMPARING APPLE S IOS WITH SAMSUNG S BADA MOBILE SOFTWARE DEVELOPMENT PLATFORMS

New Features in XE8. Marco Cantù RAD Studio Product Manager

CinePlay User Manual

Contents. About Testing with Xcode 4. Quick Start 7. Testing Basics 23. Writing Test Classes and Methods 28. At a Glance 5 Prerequisites 6 See Also 6

1. What are the System Requirements for using the MaaS360 for Exchange ActiveSync solution?


Mobile App Design and Development

App Distribution Guide

Mobile Application Development

ni.com Remote Connectivity with LabVIEW

Adobe Summit 2015 Lab 712: Building Mobile Apps: A PhoneGap Enterprise Introduction for Developers

ios Enterprise Deployment Overview

Presto User s Manual. Collobos Software Version Collobos Software, Inc

Site Configuration Mobile Entrée 4

SECTION TWO MODULE SYLLABUSES

Please note that this SDK will only work with Xcode or above. If you need an SDK for an older Xcode version please support.

Developing Cross-platform Mobile and Web Apps

Quick Start Guide Mobile Entrée 4

Kaspersky Lab Mobile Device Management Deployment Guide

A Brief Insight on IOS deployment in Education System- need for 3 rd Platform implementation in Schools

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

Transcription:

Introduction of ios Application Development & Swift Programming Language Presented by Chii Chang chang@ut.ee

Outlines Basic understanding about ios App Development Development environment: Xcode IDE Foundations and Tools Introduction of Swift programming language 2

References Free on ibooks store Free online (partial content) http://www.techotopia.c om/index.php/ios_8_a pp_development_esse ntials http://swifttutorials.com/tutorials/ Basic app 3

What is ios App Development? Why you should care? Why ios apps have higher revenue? 1. ios-device users are willing to pay for apps 2. Billing issue in developing countries for Google Play store 3. Less pirate apps in ios (close platform) http://thenextweb.com/apps/2015/07/15/app-annie-report-google-plays-downloads-top-the-app-storeas-apple-retains-revenue-lead/ by JACKIE DOVE, 15 Jul, 03:00pm in APPS 4

What is ios? Previously iphone OS Unix-based operating system. Subset of Mac OS X (based on NeXTSTEP Unix OS, 1989~1997). First smartphone OS with multi-touch graphical user interface Latest version: ios 9 ios Devices: ipod, ipod Touch, iphone, ipad etc. Highly integrated (hardware + software) Security reason;; Applications run individually, cannot interact with each other easily (ios 7-) 5

ios Application Compiler Architecture Swift Objective-C Java Virtual Machine C++ Java 3 rd Party Jailbreaking C OS 6

ios Software Stack UIKit Map Kit Game Kit Cocoa Touch Notification Center iad Message UI / Address Book UI / Event Kit UI PhotosUI Media AV Foundation Core Audio Core Image Core Graphics Quartz Core Core Text Image I/O Media Player Metal OpenGL ES Photos Core Services Accounts Address Book CFNetwork Core Data Core Foundation Core Location Core Motion Event Kit Foundation Health Kit Home Kit Newsstand Pass Kit Quick Look Social Store Kit System Configuration Core OS 7

ios Versions and Compatibility ios ver. ipod Touch 3 Devices Media Player Smart Phone Tablet ipod Touch 4 ipod Touch 5~ iphone 3GS iphone 4 iphone 4S~ ipad ipad 2~ ~ 5.1.1 ~ 6.1.6 ~ 7.1.2 ~ 8.4.1 9.0 ~ 8

Tools Required for ios App Development Xcode IDE Mac OS compiler 9

Developer Program If you want to distribute your app to App Store https://developer.apple.com/programs/how-it-works/ 10

Development Types Xcode Developer Tools Apple ID Individual Organisation Enterprise Program Xcdoe Beta Test on Device App Store Distribution In-house App Distribution Team Management Cost Free 99 USD 99 USD 299 USD Requirement 13+ 18+ DUNS Number DUNS Number 11

Alternative Development Environment (1) http://xamarin.com/platform Previous Mono Touch C# Write once, deploy on Android, ios, Windows Phone Still requires a Mac OS computer/compiler 12

Alternative Development Environment (2) http://www.smartface.io/ JavaScript Write once, deploy on Android, ios, Still requires a Mac OS computer for App Distribution Source: http://www.smartface.io/developer/guides/get-started/hello-world/ 13

Alternative Development Environment (3) Cloud Service Example: https://virtualmacosx.com/ 14

ios Device Simulator Simulator Emulator Simulator: Share hardware resources Subset of current OS Fast Emulator: Virtual machine Different OS Slow Demo Hello World iphone 4S Simulator 15

Development Environment: Xcode UI Setting Files Coding UI Components Thread tracking (e.g. for debug) Console output 16

Application Project 17

Programming Language Objective-C Swift C (limited usage) C++ (uncommon) 18

File Structure of ios App (1/2) Objective-C vs. Swift 19

Objective-C Class Header Method 20

File Structure of ios App (2/2) Header description can be included in the method file (in Objective-C) Header 21

Swift Class 22

Application Settings - Linked Framework and Libraries 23

Importing 3 rd Party Resources? Demo Bridging Objective-C class with Swift class 24

Application Settings - Media Kit 25

Application Settings - Property List (plist) and Permission Example: Location Tracking Permission Source: http://willd.me/posts/getting-started-with-ibeacon-a-swift-tutorial 26

Application Settings - Flag Example, using GDataXML (of Gdata API) 27

Application Settings Search Path 28

Application Settings Individual Class Setting (disable ARC) Disable Automatic Reference Counting (ARC) 29

Automatic Reference Counting (ARC) http://blog.teamtreehouse.com/ios-5-automatic-reference-counting-arc 30

Debug 31

Storyboard 32

Basic Graphical User Interface Layout Linking GUI objects to classes (drag and drop) in Objective-C DEMO 33

Inbuilt Database: Core Data Other Classes ViewController AppDelegate Per each application Core Data NSManagedObject Detail in later slides 34

Accessing File System? By default, an application can only access its corresponding directories Example in Objective-C: +(void)savefile:(nsdata *)adata withfilename:(nsstring *)filename andfiletype:(nsstring *)filetype { NSString *docdir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectatindex:0]; NSString *ffpath = [NSString stringwithformat:@"%@/%@.%@",docdir,filename,filetype]; [adata writetofile:ffpath atomically:yes]; } 35

Zero-configuration: Bonjour Multicast DNS (mdns) Included in foundation library: NSNetService;; CFNetServices Bonjour is a suite of protocols for zero-configuration networking over IP that Apple has submitted to the IETF as part of the ongoing standards-creation process. (Mac Developer Library) Source: https://developer.apple.com/library/mac/documentation/cocoa/concep tual/netservices/introduction.html 36

Instruments Demo 37

Programming Languages for ios App Development Objective-C (ObjC) Programming language for NeXTSTEP OS (1980s) from NeXT inc. founded by Steve Jobs in 1985 1996 (Acquired by Apple Computer) Swift Ver. 1 introduced in 2014;; Now: Swift 2, Open Source in fall 2015, introduced in WWDC 2015 1 C++ See http://www.raywenderlich.com/62989/introduction-c-iosdevelopers-part-1 1 https://developer.apple.com/swift/blog/?id=29 38

Swift has better performance WWDC 2014 39

Demo: Playground 40

Swift: Basic Syntax NS*;; e.g. NSURL, NSURLRequest, NSURLSession or NSURLConnection etc. NS stands for NeXTSTEP ;; No Semicolon required Type safe Example of Type Safe : let url = NSURL(string: "http://www.stackoverflow.com" ) var v1 = 123 41

Java, Objective-C, Swift (without importing extra libraries) Java java.lang.string or java.lang.string gender = new String( Male ); gender = Male ; Objective-C NSString *gender = [[NSString alloc] initwithstring:@ Male ]; or NSString *gender = @ Male ; Swift let gender = Male or var gender = Male or var gender: String? = Male // Constant;; Cannot be changed // Can be changed Demo

Swift: Basic Syntax Let (constant value) and Var (variable) let person = Peter var man = Peter man = Ken // this is ok person = Ken // this is an error Let π = 3.14159265359 let = "cat" print( ) //display cat 43

Swift: Basic Syntax Array var a2 = ["cat", "mouse", "dog ] print(a2[1]) //display mouse Dictionary (Hashmap) var animallist = [" ":"cat", " ":"dog", " ":"mouse"] print(animallist[" "]!) //display dog 44

Swift: Basic Syntax Dictionary (Hashmap) var animallist: [Character: String] = [:] animallist[" "] = "cat" animallist[" "] = "dog" animallist[" "] = "mouse" print(animallist[" "]!) //display "dog" 45

Swift: Basic Syntax Loop for i in 0...3 { } print(i) //display 0 1 2 3 Same as for var i = 0; i<=3; ++i { print(i) } for j in 0..<3 { } print(j) // display 0 1 2 46

Swift: Basic Syntax If let actualnumber = Int(possibleNumber) { print( \ \(possiblenumber) \ has an integer value of \(actualnumber) ) } else { print( \ \(possiblenumber) \ could not be converted to an integer ) } Source: The Swift Programming Language (Swift 2) 47

Swift: Tuples let http404error = (404, Not Found ) // http404error is of type (Int, String), and equals (404, "Not Found ) From: Apple Inc. The Swift Programming Language. ibooks. https://itun.es/au/jeuh0.l 48

Swift: Functions func greet(name: String, day: String) -> String { } return "Hello \(name)! Today is \(day)." greet( "Peter", day: "Monday" ) //display Hello Peter! Today is Monday. 49

Swift: Protocol Protocol (in Swift) is similar to Interface in Java protocol ExampleProtocol { } var simpledescription: String { get } mutating func adjust() class SimpleClass: ExampleProtocol { var simpledescription: String = } var anotherproperty: Int = 69105 func adjust() { } "A very simple class." simpledescription += " Now 100% adjusted." From: Apple Inc. The Swift Programming Language. 50

More GUI Demo Navigation Control, Image View, Table View, Web View, MapView in Swift [Partial Source code] Core Data Example: https://github.com/bnakum/tutorials from http://agstya.com/core-data-tutorial-in-swift-2-0/ TableView Example: http://kodu.ut.ee/~chang/table.zip 51

Swift: Core Data [source] https://developer.apple.com/library/ios/documentation/datamanagement/devpedia-coredata/coredatastack.html 52

Swift: Core Data let appdelegate = UIApplication.sharedApplication().delegate AppDelegate as! let managedcontext = appdelegate.managedobjectcontext //fetch all data let fetchrequest = NSFetchRequest(entityName: TheEntityName ) Demo 53

Mobile Web Service Provisioning Web Server ios Device Remote Client Wireless Sensors Demo File Upload Service hosted on iphone 54

Interesting Tools https://developer.apple.com/videos/wwdc/2015/ Mobile Web Server: CocoaHTTPServer https://github.com/robbiehanson/cocoahttpserver GData Objective-C Client https://code.google.com/p/gdataobjectivec-client/ RESTKit https://github.com/restkit/restkit AFNetworking https://github.com/afnetworking/afnetworking REStful BPEL workflow execution engine by Mobile & Cloud Lab 55

Thank you. Questions? 56