Mobile Apps Programming Chin-Sung Lin Eleanor Roosevelt High School.

Slides:



Advertisements
Similar presentations
Programming Paradigms and languages
Advertisements

Introduction to Objective-C and Xcode (Part 1) FA 175 Intro to Mobile App Development.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
1 Chapter 4 Language Fundamentals. 2 Identifiers Program parts such as packages, classes, and class members have names, which are formally known as identifiers.
Exploring the iPhone SDK Toyin Adedokun & Daniel Laughlin.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Data types and variables
Chapter 2 Data Types, Declarations, and Displays
Friday, August 29, 2014 CSCI 351 – Mobile Applications Development.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
C++ fundamentals.
UFCFX5-15-3Mobile Device Development UFCFX Mobile Device Development An Introduction to the Module.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Chapter Introduction to Computers and Programming 1.
COMPUTER SCIENCE I C++ INTRODUCTION
01- Intro-Java-part1 1 Introduction to Java, and DrJava Barb Ericson Georgia Institute of Technology June 2008.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
CIS Computer Programming Logic
FINAL PRESENTATION SYDNEY TOUR. Divya Nalla Raja Kandasamy RajaShekar Donti Ren Zhu Sadah Omar Sulaiman
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Georgia Institute of Technology Introduction to Java, and DrJava Barb Ericson Georgia Institute of Technology Aug 2005.
CISC105 General Computer Science Class 1 – 6/5/2006.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Introduction to Computer Systems and the Java Programming Language.
Folio3 IPhone Training Session 1 Presenter: Imam Raza.
CPS120: Introduction to Computer Science Decision Making in Programs.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
XP Tutorial 8 Adding Interactivity with ActionScript.
ELEMENTS OF A COMPUTER SYSTEM HARDWARE SOFTWARE PEOPLEWARE DATA.
Application Software System Software.
Monday, August 31, 2012 CSCI 333 – Systems Programming.
Types of C Variables:  The following are some types of C variables on the basis of constants values it has. For example: ○ An integer variable can hold.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and Applications software. Systems.
XP Tutorial 8 Adding Interactivity with ActionScript.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
FUNCTIONS (CONT). Midterm questions (21-30) 21. The underscore can be used anywhere in an identifier. 22. The keyword void is a data type in C. 23. Floating.
Chad’s C++ Tutorial Demo Outline. 1. What is C++? C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Best 5 Mobile App Development Tools for Developer's to think beyond the Limitation.
1Object-Oriented Program Development Using C++ Built-in Data Types Data type –Range of values –Set of operations on those values Literal: refers to acceptable.
Computer System Structures
C++ LANGUAGE MULTIPLE CHOICE QUESTION
Information and Computer Sciences University of Hawaii, Manoa
The Machine Model Memory
CSCI 351 – Mobile Applications Development
University of Central Florida COP 3330 Object Oriented Programming
Java Primer 1: Types, Classes and Operators
University of Central Florida COP 3330 Object Oriented Programming
Directions: GO THROUGH THE FOLLWING SLIDES. Make sure you have quizlet cards for all the vocabulary. Study the terms.
CSCI 351 – Mobile Applications Development
Directions: GO THROUGH THE FOLLWING SLIDES. Make sure you have quizlet cards for all the vocabulary. Study the terms GCFLearnFree website “Computer Basics”:
Procedural Programming
Introduction to Java, and DrJava part 1
PHP.
Introduction to Java, and DrJava
Digital Literacy 1.00 Computer Basics
Introduction to Java, and DrJava
Introduction to Java, and DrJava part 1
DATA TYPES There are four basic data types associated with variables:
C Language B. DHIVYA 17PCA140 II MCA.
Presentation transcript:

Mobile Apps Programming Chin-Sung Lin Eleanor Roosevelt High School

Mobile Apps Programming Mobile Platforms Mobile Programming Tools Objective-C Language Objects and Classes iPhone Apps Development Architecture iPhone Apps Tutorials Mobile Apps Development Process

Mobile Platforms

3 Major Mobile Platforms iOS Platform Windows Phone Platform Android Platform 81.3% 4.1% 13.4%Q3 2013

Mobile Platforms Mobile Platform Architecture Application – the layer users interact with. Core Libraries – the layer provides device functionality the developers use to create apps. Operating System – the layer translates programs into machine language. Hardware – the layer is the physical device. Application Core Libraries Operating System Hardware

iOS 7 Mobile Platform iOS 7 is the 7 th major release of the iOS mobile operating system. It was released on 09/18/2013. Support iPhone, iPod Touch, iPad, iPad Mini, and second-generation Apple TV. iOS 7 includes a redesigned user interface and numerous functionality changes. As of 12/2013, iOS 7 has been installed on 78% of supported devices. As of 10/2013, Apple's App Store contained more than 1 million iOS applications, 475,000 of which were optimised for iPad. These apps have collectively been downloaded more than 60 billion times.

Mobile Device Features Internet access Touch screen GPS (Global Positioning System – satellite-based system to determine a location) Local storage Camera Media playback Phone Bluetooth for device communication

Mobile Device Limitations Screen size No physical keyboard or trackball – a finger or stylus is the primary interface to the device Memory Storage Battery Life Cell network Sometimes flaky networks

Mobile Programming Tools

Mobile Developer Programs Registered Apple Developer Free to access Apple developer tools and resources for creating iOS and Mac apps, including Xcode, WWDC videos, sample code, and more. Web Address: iOS Developer Program Test your apps on devices and distribute your apps on the App Store $99 / year Web Address:

Xcode 5 & iOS 7 SDk Xcode is an integrated development environment (IDE) containing a suite of software development tools developed by Apple for developing software for OS X and iOS. Xcode provides an interface to the compiler, editor, interface builder, debugger, simulator and code profiling tools. Available for free from the App Store

Xcode 5 IDE

Xcode 5 Simulator Simulator Simulates various features of a real iOS device. Limitations Making Phone calls Accessing the Accelerometer/Gyroscope Sending and Receiving SMS messages Installing applications from the App Store Accessibility to the Camera Use of the Microphone Several Core OpenGL ES Features

Xcode 5 Instruments A performance, analysis, and testing tool for dynamically tracing and profiling OS X and iOS code. A flexible and powerful tool that lets you track one or more processes and examine the collected data. Helps you understand the behavior of both user apps and the operating system. Monitor your applications for memory leaks, which can cause unexpected results. Gain a deeper understanding of the execution behavior of your applications.

Xcode 5 Instruments

Objective-C Language Basics

An Object Oriented Programming (OOP) language. Objective-C builds on top of C, and is a superset of C. Objective-C is the primary programming language used for programming iOS devices.

Objective-C Language Basics Data Types Data Types – Signed and Unsigned Arithmetic Operators Logic Operators Compound Assignment Operators Comparison Operators Flow Control Statements Looping Statements

Objective-C Language Basics Data Types int: integer, 4 bytes unsigned int: unsigned integer, 4 bytes float: floating point number, 4 bytes double: double precision, 8 bytes char: character, 1 byte string: string, depends on number of characters bool: Boolean

Objective-C Language Basics Data Types – Signed and Unsigned int – -2,147,483,647 up to 2,147,483,647 signed – default of all variable types unsigned– maximum number 4,294,967,294

Objective-C Language Basics Arithmetic Operators - (unary): negates the value of a variable or expression +: addition -: subtraction *: multiplication /: division %: modulo

Objective-C Language Basics Logic Operators NOT (!): inverts the current value of a Boolean variable. AND (&&): return true if both of the two operands evaluated to be true. OR (||): return true if at least one of the two operands evaluated to be true. XOR (^): return true if one and only one of the two operands evaluated to be true. Ternary/Conditional Operator ([condition] ? [true expression] : [false expression]): if [condition] is true, the [true expression] will be evaluated; if [condition] is false, the [false expression] will be evaluated.

Objective-C Language Basics Compound Assignment Operators x += y: add x to y and place result in x x -= y: subtract y from x and place result in x x *= y: multiply x by y and place result in x x /= y: divide x by y and place result in x x %= y: perform modulo on x and y and place result in x x &= y: assign to x the result of logical AND operation on x and y x |= y: assign to x the result of logical OR operation on x and y x ^= y: assign to x the result of logical XOR operation on x and y

Objective-C Language Basics Comparison Operators x == y: return true if x is equal to y x != y: return true if x is not equal to y x > y: return true if x is greater than y x >= y: return true if x is greater than or equal to y x < y: return true if x is less than y x <= y: return true if x is less than or equal to y

Objective-C Language Basics Flow Control Statements with if and else if (Boolean expression) { statements; } else { statements; } if (Boolean expression) { statements; } else if { statements; } ………… if (Boolean expression) { statements; } else if { statements; } ………… else { statements; } Braces ({ }) are required if more than one statement is executed after the if/else.

Objective-C Language Basics Looping Statements for loop: for ([initializer]; [conditional expression]; [loop expression]) {statements;} while loop: while ( [conditional expression]) {statements;} do... while loop: do {statements;} while ( [conditional expression]) Braces ({ }) are required if more than one statement is executed after the if/else.

Objects and Classes

Objects Objects are based on the objects in the real world. Objects are self-contained modules of functionality that can be easily used, and reused as the building blocks for a software application. Objects consist of data variables and functions (called methods) that can be accessed and called on the object to perform tasks.

Objects and Classes Classes Objects of the same kind are said to be members of the same Class. All members of a Class are able to perform the same methods and have matching sets of instance variables. They also share a common definition. A Class defines what an Object will look like when it is created. A Class defines what the Methods will do and what Instance Variables will be.

Objects and Classes Creating New Classes First need to declare it using an interface and then define it using an implementation. The declaration (.h) and the definition (.m) are usually written in two separate files. Both the declaration and the definition parts use compiler directives. A compiler directive is an instruction to the Objective-C compiler prefixed by sign. The declaration is signaled to the compiler using directive, while the definition is signaled using directive.

Objects and Classes Creating New Classes – Declaration A new class MyClassName is declared and is a subclass of the MyParentClassName MyClassName : MyParentClassName { // attribute declarations: (instance variables) } // method

Objects and Classes Creating New Classes – Declaring Instance Variables Data Encapsulation: Data should be stored within classes and accessed only through methods defined in that class. Data encapsulated in a class are referred to as instance variables (ivars). Instance Variables are declared in the same way any other variables are declared in Objective-C.

Objects and Classes Creating New Classes – Declaring Instance Variables Two new instance variables of class MyClassName are declared between the MyClassName : MyParentClassName { int firstVar; int secondVar; } // method

Objects and Classes Creating New Classes – Defining Instance Methods Methods: The methods of a class are code routines that can be called upon to perform specific tasks within the context of an instance of that class. Methods come in two different forms, class methods (preceded by +) and instance methods (preceded by -). Class methods operate at the level of the class such as creating a new instance of a class. Instance methods operate only on the instance of the class.

Objects and Classes Creating New Classes – Defining Instance Methods Data Type of Methods: – If a method returns a result, the name of the method must be preceded by the data type returned enclosed in parentheses. – If a method does not return a result, then the method must be declared as void. Arguments of Methods: If data (called arguments) needs to be passed through to a method, the method name is followed by a colon, the data type in parentheses, and a name for the argument. Methods may accept more than one arguments.

Objects and Classes Creating New Classes – Defining Instance Methods Three new instance methods of class MyClassName are declared between the closing MyClassName : MyParentClassName { int firstVar; int secondVar; } - (void) setMyClass: (int) x andNext: (int) y; - (int) addVariables; - (void)

Objects and Classes Creating New Classes – Declaring Class Implementation Method Implementation: write the code for the methods we have declared earlier in section of the class declaration (.h). Methods are implemented in section of the class definition (.m).

Objects and Classes Creating New Classes – Declaring Class Implementation Two methods of class MyClassName are implemented in section of the MyClassName.m file. #import MyClassName - (void) setMyClass: (int) x andNext: (int) y; { firstVar = x; secondVar = y; }

Objects and Classes Creating New Classes – Declaring Class Implementation - (int) addVariables; { return firstVar + secondVar; } - (void) displayVariable: (int) x; { value = %i and %d” firstVar, secondVar ;

iPhone Apps Development Architecture

Mobile Apps Development Architecture A few fundamental design patterns that form the development architecture of any apps. Model-View-Controller— governs the overall structure of your app. Target-Action— translates user interactions with buttons and controls into code that your app can execute. Subclassing— creates new classes from an existing class and extends the functionality. Delegation— facilitates the transfer information and data from one object to another.

Mobile Apps Development Architecture Model-View-Controller Separating user interface from application logic and data handling. Model-View-Controller (MVC) methodology increases reusability. MVC is the paradigm of iOS programming. –Model: Hold data, should know nothing of the interface. –View: code for getting data in/out of a view. Deals with items like buttons, lists, tables, etc. –Controller: keeps the Model objects and View objects in sync. Model, View and Controller are objects.

Mobile Apps Development Architecture A view controller object interacts with model through Methods and Properties exposed by the Model object. A view controller object interacts with view through Target-Action pattern, together with Outlets and Actions.

Model-View-Controller

Mobile Apps Development Architecture Target-Action pattern, IBOutlets and IBActions A view controller object interacts with view through Target-Action pattern, together with Outlets and Actions. Target-Action connects the triggered events in the user interface to the specific methods in the view controller using actions. An Action is a method defined within a view controller object that is designed to be called when an event is triggered in a view object. The opposite of an Action is the Outlet. An Outlet allows a view controller object method to directly access the properties of a view object.

Mobile Apps Development Architecture Subclassing A major feature of an Objective-Oriented Programming environment. The new class inherits all the functionality of the parent class combined with the additional new methods and properties. Ex: UIViewController is a generic view controller from which we will create a subclass so that we can add our own methods and properties.

Mobile Apps Development Architecture Delegation Allows an object to pass the responsibility for performing one or more tasks onto another object. Allows the behavior of an object to be modified without having to go through the process of subclassing it. Ex: UIApplication delegates the applicationDidFinishLaunchingWithOptions: method to us so that we can write code to perform specific tasks when the app first loads.

iPhone Apps Tutorials

iPhone App ELRO Movie Channel

ELRO Movie Channel

iPhone App Quadratic Calculator

Quadratic Calculator

iPhone App Multimedia Player

Multimedia Player

iPhone App Flappy Bird Game App

Multimedia Player

Mobile Apps Development Process Start from your…… needs, problems, dreams, or, start from other people’s needs, problems, dreams.

Mobile Apps Development Process Planning Process Define the purpose and functionality of the mobile apps, Sketch the user interface (UI), and identify the required UI components, Specify the flow control, and configure the storyboard, List the number and types of images, graphics, videos, animations, audios and sound effects required by the user interface of the apps, Identify the programming skill sets required for the apps, and Assign action items and set the project schedule.

Mobile Apps Development Process Implementation Process Design the user interface (UI), and photoshop the required UI components. Specify the flow control, and configure the storyboard. Acquire or create various types of images, graphics, videos, animations, audios and sound effects required by the user interface of the apps. Do online research and acquire the programming skill sets required for the apps. Create product description and promotion document for the App Store. Check project schedule and progress, and identify ricks and issues.

Q & A