my first iphone app

25
My First iPhone App Dr. Luis Weruaga

Upload: ritika-singh

Post on 18-Mar-2016

218 views

Category:

Documents


1 download

DESCRIPTION

Presentation on "My First iPhone App" by Dr. Luis Weruaga

TRANSCRIPT

My First iPhone AppDr. Luis Weruaga

What is the iPhone?

CPU 1-GHz GPU 512 MB 32 GB 960 x 640 WiFi/3G GPS touchscreen 2 cameras accelerometer

compass gyroscope bluetooth multitask ...

2

Applications

• Audio & Video

• Mathematical Computation

• Data Management

• Graphics & Animation

• Networking & Internet

• Security

• User Interface

3

iPhone Programming

To get started you just need one of these ...

4

Starting Kit

iMac

+

5

• XCodeApp development environment.

• Interface BuilderGraphical tool for GUI development.

• iPhone SimulatorRun Apps in the Mac.

• InstrumentsMeasure the App performance.

6

XCodeSoftware development environment for the iPhone, for the Mac, for Mac OS ...

7

• It is Apple’s programming language, for iPhone & Mac.

• Objective-C is a superset of GNU C/C++.

• XCode understands and compiles C/C++ code.

• iPhone APIs are invoked with Objective-C code.

• However C++ can be used anywhere in your project.

• Objective-C gets closer to “natural language” programming: intuitive and easy-to-read.

8

More on

• Objective-C is strongly influenced by

• Smalltalk was created to underpin the “new world” of computing exemplified by “human–computer symbiosis.”

[object method1:parm1 method2:parm2 ...]

UIView* myView = [[UIView alloc] initWithFrame:[UIScreen mainScreen]];

[NSThread detachNewThreadSelector:@selector(myThreadCode) toTarget:self withObject:nil];

• Some actual examples of Objective-C code:

9

Static Analyzer• Tool in XCode for finding potential bugs without

running the executable.

10

Development Tools

• XCodeApp development environment.

• Interface BuilderGraphical tool for GUI development.

• iPhone SimulatorRun Apps in the Mac.

• InstrumentsMeasure the App performance.

11

iPhone Simulator• It runs iPhone/iPad Apps on the Mac.

• For testing and validating the outcome of the App.

12

Development Tools

• XCodeApp development environment.

• Interface BuilderGraphical tool for GUI development.

• iPhone SimulatorRun Apps in the Mac.

• InstrumentsMeasure the App performance.

13

Instruments

14

Development Tools

• XCodeApp development environment.

• Interface BuilderGraphical tool for GUI development.

• iPhone SimulatorRun Apps in the Mac.

• InstrumentsMeasure the App performance.

$015

Testing the Project

Simulator

Device

the Project

XCode16

Installing App in Device

17

iPhone University Program• Student Development Team.

Up to 200 students.

• Development ResourcesiPhone Dev Center.

• Test on iPhone, iPad, & iPod TouchInstall applications directly on the real devices.

• Sharing applicationsAllows students and professors within the same team to share their applications.

http://developer.apple.com/programs/iphone/university/

$018

Developer Programs

19

Some Useful Links

• Stanford’s iPhone Competition. http://studentapps.stanford.edu/

• iPhone Developer University Program. http://developer.apple.com/programs/iphone/university/

• MacLab Program http://www.apple.com/education/maclabs/

• iPhone Developer Program http://developer.apple.com/iphone/index.action

20

iPhone OS (iOS) architecture1. Core OS—This level contains the kernel, the file system, networking

infrastructure, security, power management, and device drivers. It also the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs.

2. Core Services—The frameworks in this layer provide core services, such as string manipulation, data management, networking, URL utilities, contact management, and preferences. This layer includes Core Foundation, which provides abstractions for common data types (such as strings and collections).

3. Media—The frameworks and services provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, OpenGL ES, Core Animation, Core Audio, and video playback.

4. Cocoa Touch—The frameworks in this layer directly support applications based on iOS. They include several Objective-C frameworks that are particularly important for developing applications for iOS.

21

iOS Frameworks1 2 3

4

22

23

Hands-On

24

UIApplicationDelegate

“Hello World” App

25

UIViewController

UILabel

UITextField

iOS