iPhone Programming

25
iPhone Programming Speaker Shashank Garg

description

 

Transcript of iPhone Programming

Page 1: iPhone Programming

iPhone Programming

Speaker Shashank Garg

Page 2: iPhone Programming

What is iPhone

• Smart Phone by Apple.

• Why is iPhone an iPhone, not just Phone ??????• Built in Accelerometer

• GPS or Position Triangulation

• Multi Touch Interface

• Keyboard

• Safari

• Mail

• Calendar

• Wide Screen Display» I think biggest in the market

Page 3: iPhone Programming

What do u need to Program for iPhone

• Intel-based Macintosh running Leopard(OS X 10.5.3 or later).

Page 4: iPhone Programming

iPhone Development

• Development done with the help of iPhone SDK• Uses Objective-C• IDE XCODE• Only push your application through App Store

• 99 $ membership

• Review of your application» Code also

• 70 % and 30 % share.

Page 5: iPhone Programming

iPhone SDK• iPhone Sdk have five powerful tools to do iPhone

programming.

1. XCODE• Professional text editor• Debugger• GCC compiler

2. Interface Builder• For creating user interface

3. Instruments• For optimizing application

4. Dash Code• For creating web applications for Safari

5. iPhone Simulator

Page 6: iPhone Programming

Things to consider before programming

• Low resources• 128 mb Ram• Limited Battery life

• Application should take less execution time.• Single Window• Multi Touch Events

Page 7: iPhone Programming

iPhone OS overview and Technologies

iPhone Os can be viewed as set of layers

Page 8: iPhone Programming

Cocoa Touch Layer• The Cocoa Touch layer comprises UIKit.framework and

Foundation.framework

• iPhone OS uses this layer to implement features:– Application management

– Event-handling support

– User interface management

– Support for text and web content

– Accelerometer data

– The built-in camera

Page 9: iPhone Programming

Media Layer

• Graphics Technologies– OpenGLES.framework (OpenGL), QuartzCore.framework (Core Animation)

• Core Audio– CoreAudio.framework, AudioToolbox.framework,

AudioUnit.framework (playback and recording, audio processing).

• Video Technologies– iPhone OS provides support for full-screen video playback through

the Media Player framework (MediaPlayer.framework)

Page 10: iPhone Programming

Core Services• The Core Services layer provides the fundamental system services that all

applications use

• Address Book– AddressBook.framework: provides access to the contacts stored on a

user’s device

• Core Location– CoreLocation.framework: lets you determine the current latitude and

longitude of a device

• CFNetwork– CFNetwork.framework: Provides communication with FTP and HTTP

servers

• SQLite– The SQLite library lets you embed a lightweight SQL database into your

application

Page 11: iPhone Programming

Core OS• The Core OS layer encompasses the kernel environment,

drivers, and basic interfaces of the operating system

• iPhone OS provides a set of interfaces for accessing many low-level features of the operating system. Your application accesses these features through the LibSystem library. The interfaces are C-based and provide support for the following:

– Threading (POSIX threads)

– Networking (BSD sockets)

– File-system access

– Standard I/O

– Memory allocation

Page 12: iPhone Programming

iPhone Hardware and Software features that can be incorporated in applications

• Accelerometer

– iPhone and iPod touch have 3 accelerometers to measure changes along each of the primary axes in three-dimensional space, which allows you to detect motion in any direction

– Applications that want to access the accelerometer data directly can also do so using UIKit

Page 13: iPhone Programming

iPhone Hardware and Software features that can be incorporated in applications

• Core Location

– The Core Location framework monitors signals coming from cell phone towers and Wi-Fi hotspots and uses them to triangulate the user’s current position

– Use this framework judiciously to not drain the user’s battery

Page 14: iPhone Programming

iPhone Hardware and Software features that can be incorporated in applications

• Contacts– You can access the user’s contact information using the Address Book UI

framework

Page 15: iPhone Programming

iPhone Hardware and Software features that can be incorporated in applications

• The Camera and Photo Library– iPhone has an inbuilt camera as well as a centralized photo library

whereas iPod Touch doesn’t have a camera

– iPhone OS provides access to both of these features through classes in the UIKit framework

Page 16: iPhone Programming

Styles of Programming for iPhone

• iPhone OS defines three basic styles for applications:

• Productivity style

• Utility style

• Immersive style

Page 17: iPhone Programming

Productive Style

• Productivity Applications– The focus is on the organization and manipulation of detailed information

– Typically rely on system views and controls (text fields, labels, and other data-oriented views) for their presentation and do little or no custom drawing

– Example: The Settings application

Page 18: iPhone Programming

Utility Style

• Utility Applications– Perform a targeted task that requires relatively little user input

– A quick summary of information or a simple task on a small number of objects

– Examples: Weather and Stocks applications

Page 19: iPhone Programming

Immersive Application

• Immersive Applications– Offer a full-screen, visually rich environment that’s focused on the content

and the user’s experience with that content

– Commonly used for implementing games and multimedia-centric applications

– Example: Media Player application

Page 20: iPhone Programming

Our Project

• GeoXray• LocateMe Feature.• Search POI’s around Current Location.• Fetch Relevant News Articles

Page 21: iPhone Programming

GeoXray

• Used UIWebkit to display map.• Frameworks:

• UIKit

• Json

• CoreLocation

• MapKit

• Foundation

Page 22: iPhone Programming

GeoXray

On iPhone Side• Connect iPhone to the Geosemble Server.

• Retrieve the Data in JSON format.

• Parse the data and populate the map view and the Table Views.

Page 23: iPhone Programming

Challenges

• Objective C, if you are a pure Java programmer

• One time, only one application is executable. -State Saving(NSArchiver).

• Memory leaks - Use Application tool to Fix Memory Leaks. - Use instruments with the code running on the

device to See how much memory is being used.

Page 24: iPhone Programming

Questions?

Page 25: iPhone Programming

Thanks

Name: Shashank Garg Email : [email protected]