iPhone Programming
description
Transcript of iPhone Programming
iPhone Programming
Speaker Shashank Garg
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
• Calendar
• Wide Screen Display» I think biggest in the market
What do u need to Program for iPhone
• Intel-based Macintosh running Leopard(OS X 10.5.3 or later).
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.
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
Things to consider before programming
• Low resources• 128 mb Ram• Limited Battery life
• Application should take less execution time.• Single Window• Multi Touch Events
iPhone OS overview and Technologies
iPhone Os can be viewed as set of layers
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
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)
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
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
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
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
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
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
Styles of Programming for iPhone
• iPhone OS defines three basic styles for applications:
• Productivity style
• Utility style
• Immersive style
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
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
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
Our Project
• GeoXray• LocateMe Feature.• Search POI’s around Current Location.• Fetch Relevant News Articles
GeoXray
• Used UIWebkit to display map.• Frameworks:
• UIKit
• Json
• CoreLocation
• MapKit
• Foundation
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.
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.
Questions?
Thanks
Name: Shashank Garg Email : [email protected]