i phone development presentation
DESCRIPTION
TRANSCRIPT
iPhone DevelopmentAhmed Essam
Software Research Engineer @ Unisoft
Agenda
Mobile Application Development
iPhone Development methods
iPhone Development tools
Introduction to Objective C
Introduction to iPhone SDK
Demo
Advice
Be neutral when it comes to technology to be able to make the right decision
Mobile Application
There is three ways to do mobile applications
Mobile Web Interface
Develop for Java or Flash
Develop for the native platform
Mobile Web Applications
This application is mostly connected, so most of the time user can’t handle it without internet or cached history
Javascript provides reach function to access some hardware like GPS and other devices specific hardware
Developer doesn’t have much authority over the device, tied by the browser.
Java
In some cases you can use Java but not all platforms supports Java as it is for instance
BlackBerry
You can use Java but it must be compiled using BB tools
iPhone
Doesn’t Support Java at all
Android
It is Java but not as J2ME developers used to.
Flash
Can be used if the application is all about interface
currently flash can be used to act like real application, it has access to camera, GPS... etc
iPhone doesn’t support it.
Native Applications
You can do what ever you want to,except what the framework doesn’t allow you to do.
Native Development
Windows Mobile SDK
C#, C/C++ (Very easy to do apps on this SDK)
Android SDK
C (Doing libraries that will be used by Java Apps), Java
BlackBerry SDK
Java ( You need to package the Java code using the SDK )
Nokia SDK
Java, C++ ( I call it Symbian’s C++, needs some time to use it)
Why not Java
Every device has its own characteristics and style
Java is annoying to protect the user, “Do you allow this application to do .....?”
You can’t know the (keyboard or keypad) layout
Canvas or default system controls
When using canvas you have to handle little everything
Many features can’t be used.
Personally
I like:
Windows mobile (Low level guys will enjoy it)
iPhone (Most of the work REALLY done)
Android (I love the idea of Open Source)
iPhone Development Methods
iPhone Web Applications
Normal web site with specified for iPhone using some JS functions that is provided by the Safari
iPhone Native Applications
Using Objective C
iPhone SDK
Jailbreak iPhone development tools
Jailbreak iPhone development
I don’t know much about it but
You can do really what every you like all the undocumented functions are yours
You can’t publish such app in the apps store
You can publish such app in Cydia
Needed to develop for iPhone
Knowledge of C
Mac OS X Intel based machine
iPhone Developer program
iPhone or iPod touch
iPhone Development tools
Xcode
Interface Builder
Instruments
Objective C
You can consider it Extension for C language
ObjC add more dynamicity to C Language
Single inheritance from super class and protocols is used as interfaces
Totally new syntax but still can use C with it.
Objective C
• New concepts
• Class definition
• Protocol implementation
• Class messages
• All objects are heap based & no stack objects
• Classes and Instances are both objects
• Class is a blue print to create instance
Classes and Objects
• Classes declare the state and behavior
• State (class data) is instance variables and behavior is methods
• Instances are hidden, it can be accessed through getters and setters
Class and instance methods
• Instances responds to “Instance methods”
• -(id)init;
• -(char*)getName;
• Class responds to “Static methods”
• +(id)alloc;
• +(char*)getClassName;
Message syntax (calling methods)• Function calling in Objective C called message, this is to give
more dynamicity to the language, some times if the method is not implemented the calling result will be nil = null
• [objectOfClass functionName];
• [objectOfClass functionName:Arg1];
• Calling staic method
• [Class functionName];
• [Class functionName:Arg1];
• Function also called selector, this is helpful in cases of passing the function name as parameter.
Objective C• Dot Syntax
• It is only working in Objective C 2.0
• It is only used for properties of object
• Dynamic Casting
• Using type “id” , id is pointer to void “C Style void*”
• id object = [Class new];
• Static casting
• Class* object = [Class new];
Objective C• nil is equivalents to null
• Objective C Class has no operators overloading
• Objective C Class has no constructors or destructors
• Boolean type is, BOOL
• YES is TRUE
• NO is FALSE
• Pointer to function in class called selector
• SEL method = [object event];
• [object setEvent:@selecyot(function:)];
• SEL function = @selector(function::);
iPhone frameworks• Foundation
• UIKit
• CoreGrphics
• CFNetwork
• CoreLocation
• CoreData
• ExternalAccessory
• GameKit
MapKit
IOKit
MediaPlayer
AddressBook
MobileCoreSerivces
OpenGL
Security
StoreKitAnd many more
iPhone Development
• It is true that Objective C is not as strong as any other language but the huge coverage of frameworks that is provided by Apple makes it Ok to use such SDK
• From My experience I can tell, that there is too many things already done for me in way that make me use it in no time considering other platforms
Demo
Refernces
• iPhone Development course form Stanford CS193P
• Objective C developers guide
Contact me
• Ahmed Essam Naiem
• http://www.ahmed-essam.com
• http://www.twitter.com/Neo_4583
• http://www.facebook.com/aessam