SlideShare a Scribd company logo
1 of 128
an introduction
          to iPhone
        development


 Tobias Torrissen
Know IT Objectnet
• Tobias Torrissen
Agenda
•   About the iPhone

•   The problem: About the example application

•   About the development environment

•   Objective C

•   Common API-s

    •   XML parsing API

    •   Core Location
iPhone 3GS
• 3GS
• Wi-Fi (802.11b/g)
• Bluetooth
• Accelorometer
• 600 MHz
• GPU
• 256 MB DRAM
• A-GPS
The
problem
Usecase
Usecase
Usecase
Usecase
Usecase
• Idea: let´s create an app
  that helps you find your
  way home.
• [screencast]
Challenges
• Where am I?
 • What´s the address?
• What is the route home?
• When is the buss supposed
  to arrive
• When does the buss actually
  arrive?
• Where am I?
 • What´s the address?
• What is the route home?
• When is the buss supposed
  to arrive
• When does the buss actually
  arrive?
• Where am I?
 • What´s the address?
• What is the route home?
• When is the buss supposed
  to arrive
• When does the buss actually
  arrive?
Architecture
positioning
reverse geocoding

positioning



              route info
reverse geocoding

positioning



              route info
reverse geocoding

positioning



                       route info


              realtime info
iPhone SDK
• Core Location
• Orientation
• Acceleration
• Core Animation
• 3D Open GL ES
• 2D Quarts
• Audio playback
• Video playback
• Touch events
• Integrated Webview
• Contacts
• Images
• Camera
• etc.
Xcode
Interface builder
screenshot
screenshot
screenshot
screenshot
screenshot
screenshot
screenshot
screenshot
iPhone simulator
Instruments
Coding Objective C
•   Small extention to ANSI C

•   About ten new reserved words

•   Syntactical changes influenced by SmallTalk

•   Used primarily by Apple.

•   OpenStep standard

•   Dynamic typing

•   “Explicit” memory management
[object method:parameters]
Defining interfaces
@interface ClassName : SuperClassName
{
	 int	 	 	 count;
	 int	 	 	 data;
	 NSString*	 aString;
}

@property(nonatomic, retain) NSString* aString;

- (ClassName*) initWithSome: (NSString*) value;
- (void) myObjectMethod:(NSString*)paramName;
+ (void) myClassMethod:(NSString*)paramName;
- (void) placeDocumentInQueue:(NSString) document
before:(int) document after:(int) document;
Defining classes
#import "ClassName.h"

@implementation SomeClass

@synthesize aString;

-   (ClassName*) initWithSome:(NSString) value{
	   self = [super init];
	   if (self) {
	   	     [self setvalue: vale];
	   }
}

- (void) myObjectMethod:(NSString*)paramName {
	 	     // do stuff
}
+ (void) myClassMethod:(NSString*)paramName{
	 	     // do stuff
}
- (void) placeDocument:(NSString) document InQueue:(int) queueId
Before:(int) documentId after:(int) documentId {
	 	     // do even more!
}
Tricky stuff
Delegates
When you call a API class, you often send a reference to your self or some
other class which will recieve callbacks on certain events

Parameters
Almost named parameters, but the order is significant.

Memory allocation.
retain - instance counter++

release - instance counter --

[NSAutoreleasePool] - Inserted objects gets released
automaticlu
A walkthrough of the
example application
• Where am I?
 • What´s the address?
• What is the route home?
• When does the buss actually
  arrive?
•   Create a project in xCode, create GUI

•   Write some code and connect the GUI to it

•   Use core location

•   Get some XML and parse the result
Getting started
•Create project
•Add some controls
•Run in simulator
[screencast]
do something...
•Connect the controls and
 the code
•Write a simple message in
 the text field
•Connect the controls and
 the code
•Write a simple message in
 the text field
[screencast]
Using Core Location
•Wifi-hotspots
•Wifi-hotspots

•Base stations
•Wifi-hotspots

•Base stations

•A-GPS
Core Location


                Basestasjoner




CLLocation
                Wifi-hotspots
Manager




                   A-GPS
Core Location


                              Basestasjoner




Objective-C   CLLocation
                              Wifi-hotspots
Class         Manager




                                 A-GPS
Core Location


                                                   Basestasjoner




              Register the class




Objective-C                        CLLocation
                                                   Wifi-hotspots
Class                              Manager




                                                      A-GPS
Core Location


                                                   Basestasjoner




              Register the class

              Start positioning



Objective-C                        CLLocation
                                                   Wifi-hotspots
Class                              Manager




                                                      A-GPS
Core Location


                                                   Basestasjoner




              Register the class

              Start positioning



Objective-C                        CLLocation
                                                   Wifi-hotspots
Class                              Manager




                                                      A-GPS
Core Location


                                                    Basestasjoner




              Register the class

              Start positioning



Objective-C    New position found   CLLocation
                                                    Wifi-hotspots
Class                               Manager




                                                       A-GPS
Core Location


                                                    Basestasjoner




              Register the class

              Start positioning



Objective-C    New position found   CLLocation
                                                    Wifi-hotspots
Class                               Manager




                                                       A-GPS
Core Location


                                                    Basestasjoner




              Register the class

              Start positioning



Objective-C    New position found   CLLocation
                                                    Wifi-hotspots
Class          New position found   Manager




                                                       A-GPS
Core Location


                                                    Basestasjoner




              Register the class

              Start positioning



Objective-C    New position found   CLLocation
                                                    Wifi-hotspots
Class          New position found   Manager




                                                       A-GPS
Core Location


                                                    Basestasjoner




              Register the class

              Start positioning



Objective-C    New position found   CLLocation
                                                    Wifi-hotspots
Class          New position found   Manager
               New position found




                                                       A-GPS
Core Location


                                                    Basestasjoner




              Register the class

              Start positioning



Objective-C    New position found   CLLocation
                                                    Wifi-hotspots
Class          New position found   Manager
               New position found


              Stop positioning




                                                       A-GPS
@interface LocationController : NSObject <CLLocationManagerDelegate> {
	 CLLocationManager *locationManager;
	 id delegate;
}

@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, assign) id delegate;

- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation;

- (void)locationManager:(CLLocationManager *)manager
       didFailWithError:(NSError *)error;

@end
@implementation LocationController

@synthesize locationManager, delegate;

// Constructor.
- (id) init {
    self = [super init];
    if (self != nil) {
        self.locationManager = [[[CLLocationManager alloc] init] autorelease];
        self.locationManager.delegate = self; // send loc updates to myself
    }
    return self;
}

// Called when the locationmanager finds a new update on posission
- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation
{
    [self.delegate locationUpdate:newLocation];
}

// Called if an error occurs.
- (void)locationManager:(CLLocationManager *)manager
	     didFailWithError:(NSError *)error
{
    [self.delegate locationError:error];
}

// free the memory
- (void)dealloc {
     [self.locationManager release];
     [super dealloc];
}
@end
[..]

locationController = [[LocationController alloc]init];
locationController.delegate = self;

[..]

[locationController.locationManager startUpdatingLocation];

[..]

- (void)locationUpdate:(CLLocation *)location {
    myTextField.text = [location description];
	 [locationController.locationManager stopUpdatingLocation];
}

- (void)locationError:(NSError *)error {
    myTextField.text = [error description];
}
Parsing XML
XML parsing
Event based XML parsing:
- (void)parser:(NSXMLParser *)parser didStartElement:
(NSString *)elementName

- (void)parser:(NSXMLParser *)parser foundCharacters:
(NSString *)string

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString
*)elementName

- (void)parserDidEndDocument:(NSXMLParser *)parser
<DISMessages SubscriptionID="1">

  <DISDeviation TimeStamp="2009-04-27T13:17:10.201+02:00">
    <DISID>Stortinget</DISID>
    <LineID>3</LineID>
    <DestinationStop>Mortensrud</DestinationStop>
    <ScheduledDISArrivalTime>2009-04-27T13:40:30.000+02:00<ScheduledDISArrivalTime>
    <ExpectedDISArrivalTime>2009-04-27T13:40:55.000+02:00</ExpectedDISArrivalTime>
  </DISDeviation>

  <DISDeviation TimeStamp="2009-04-27T13:17:10.201+02:00">
    <DISID>Stortinget</DISID>
    <LineID>4</LineID>
    <DestinationStop>Bergkrystallen</DestinationStop>
    <ScheduledDISArrivalTime>2009-04-27T13:42:30.000+02:00</ScheduledDISArrivalTime>
    <ExpectedDISArrivalTime>2009-04-27T13:45:55.000+02:00</ExpectedDISArrivalTime>
  </DISDeviation>

</DISMessages>
//
//   ArrivalInfo.h
//   rOOts2
//
//   Created by Tobias K Torrissen on 4/27/09.
//   Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>



@interface   ArrivalInfo : NSObject {
	 NSString   *DestinationStop;
	 NSString   *ExpectedDISArrivalTime;
	 NSString   *ScheduledDISArrivalTime;
	 NSString   *LineID;
}

@property(nonatomic,   retain)   NSString   *ExpectedDISArrivalTime;
@property(nonatomic,   retain)   NSString   *ScheduledDISArrivalTime;
@property(nonatomic,   retain)   NSString   *LineID;
@property(nonatomic,   retain)   NSString   *DestinationStop;
@end
//
//    ArrivalInfo.m
//    rOOts2
//
//    Created by Tobias K Torrissen on 4/27/09.
//    Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "ArrivalInfo.h"



@implementation ArrivalInfo

@synthesize DestinationStop, ExpectedDISArrivalTime,
ScheduledDISArrivalTime, LineID;

-   (void) dealloc {
	
	   [DestinationStop release];
	   [ExpectedDISArrivalTime release];
	   [ScheduledDISArrivalTime release];
	   [LineID release];
	   [super dealloc];
}

@end
#import <Foundation/Foundation.h>
#import "ArrivalInfo.h"
#import "ROOts2AppDelegate.h"



@interface RealTimeParser : NSObject {

	 	   ArrivalInfo *currentArrivalInfo;
	 	   NSMutableString *valueInProgress;
	 	   rOOts2AppDelegate *delegate;	 	
}

- (RealTimeParser *) initRealTimeParser;
@end
// called whenever an start element is reached.
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
	 attributes:(NSDictionary *)attributeDict {
	
	 if([elementName isEqual:@"DISMessage"]){
	 	       NSLog(@"start dataset");
	 	       currentArrivalInfo = [[ArrivalInfo alloc]init];

	 }
}
// save the actual value...
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
	
	 if(!valueInProgress)
	 	       valueInProgress = [[NSMutableString alloc] initWithString:string];
	 else
	 	       [valueInProgress appendString:string];
}

// when ever you reach a end document tag.
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
	
	 if([elementName isEqualToString:@"DISDeviation"]) {
	 	       NSLog(@"Adding travel info to deligate");
	 	       [delegate.records addObject:currentArrivalInfo];
	 	       [currentArrivalInfo release];
	 	       currentArrivalInfo = nil;
	 } else if ([elementName isNotEqualTo:@"DISMessages"]) {
	 	       [currentArrivalInfo setValue:valueInProgress forKey:elementName];
	 	       NSLog(@"Adding key, value %@, %@ n", elementName, valueInProgress);
	 }
	 [valueInProgress release];
	 valueInProgress = nil;
}
NSURL *url = [[NSURL alloc] initWithString:@"http://
www.sis.trafikanten.no:8088/xmlrtpi/dis/request?DISID=SN
$03011330"];
	
NSXMLParser *xmlParser = [[NSXMLParser alloc]
initWithContentsOfURL:url];
	
RealTimeParser *parser = [[RealTimeParser alloc]
initRealTimeParser];

[xmlParser setDelegate:parser];
	
BOOL success = [xmlParser parse];	
if(success)
	 NSLog(@"No Errors");
else
	 NSLog(@"Error Error Error!!!");
How to get
 into iPhone
development
• You need to
  register...
• You need to
  register...
 •   Apple ID
• You need to
  register...
 •   Apple ID

 •   iPhone Developer
• You need to
  register...
 •   Apple ID

 •   iPhone Developer

 •   iPhone Developer
     Program
•   Personal
    •   99$

    •   can distribute through appstore
•   Personal
    •   99$

    •   can distribute through appstore

•   Enterprise
    •   299$

    •   can not distribute through appstore
?
•   well...




?
•   well...




?
    •   The phone is
        amazing.
•   well...




?
    •   The phone is
        amazing.

    •   Xcode is OK
•   well...




?
    •   The phone is
        amazing.

    •   Xcode is OK

    •   The politics are
        mindboggeling
•   well...




?
    •   The phone is
        amazing.

    •   Xcode is OK

    •   The politics are
        mindboggeling

    •   Look out for
        Android
News in iPhone 3.0
•   peer-to-peer connections over Bonjour;

•   an app interface for hardware accessories;

•   access to the iPod music library;

•   a new Maps API

•   long-awaited push notification support.
•   API for streaming audio and video directly over
    HTTP

•   control of the proximity sensor

•   audio recording features

•   a battery API
Thank you!
Networking
NSMutableURLRequest *theRequest = [[NSMutableURLRequest alloc] init];
NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];

[theRequest setURL:[NSURL URLWithString:@"http://service-test.1881.no/SearchService/v4_2/SearchService.asmx"]];

[theRequest setHTTPMethod:@"POST"];
[theRequest setValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest setValue: @"http://Opplysningen.WebService.SearchService/2006/10/MultiSearchSingleResult"
forHTTPHeaderField:@"SOAPAction"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];

NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

if(connection) {
    webData = [[NSMutableData data] retain];
} else {
    NSLog(@"ERROR with connection");
}
[theRequest release];
}

-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
	 [webData setLength:0];
}

-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data
{
	 [webData appendData: data];
}

-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
	 NSLog(@"ERROR with the connection");
	 [spinner stopAnimating];
	 [connection release];
	 [webData release];
	 [query release];
}

-(void)connectionDidFinishLoading:(NSURLConnection *) connection
{
	 NSLog(@"DONE loading. Recieved BYTES: %d", [webData length]);
NSString *soapMessage = [NSString stringWithFormat:
 @"<?xml version="1.0" encoding="utf-8"?>n"
 "<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/
XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">n"
"<soap:Body>n"
"<MultiSearchSingleResult xmlns="http://Opplysningen.WebService.SearchService/2006/10">n"
"<MultiSearchRequest>n"
"<GetAdvertisements>false</GetAdvertisements>n"
"<ResponseType>None</ResponseType>n"
"<PageSize>20</PageSize>n"
"<Offset>0</Offset>n"
"<SearchQuery>%@</SearchQuery>n"
"<PartnerGuid>20ecc3d7-8057-4512-8aab-e3bf55470333</PartnerGuid>n"
"<MultiSearchFilter>n"
"<GetPersonSearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</
GetPersonSearch>n"
"<GetAddressSearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</
GetAddressSearch>n"
"<GetCompanySearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</
GetCompanySearch>n"
"<GetBusinessSearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</
GetBusinessSearch>n"
"</MultiSearchFilter>n"
"<DetailLevel>Basic</DetailLevel>n"
"<RequireMapCoordinates>false</RequireMapCoordinates>n"
"</MultiSearchRequest>n"
"</MultiSearchSingleResult>n"
"</soap:Body>n"
"</soap:Envelope>n", query];

More Related Content

Viewers also liked

Bureau 20091012 Nl Leukwerkt
Bureau 20091012 Nl LeukwerktBureau 20091012 Nl Leukwerkt
Bureau 20091012 Nl LeukwerktRikSmeenk
 
NTL Bellona Sørmarka
NTL Bellona SørmarkaNTL Bellona Sørmarka
NTL Bellona SørmarkaDag Westhrin
 
Social Commerce App UI/UX Concept
Social Commerce App UI/UX ConceptSocial Commerce App UI/UX Concept
Social Commerce App UI/UX ConceptKarthik Kasoju
 
CIOForum
CIOForumCIOForum
CIOForumtobiast
 
NAV pensjonsprogrammet NTL 22042010
NAV pensjonsprogrammet NTL 22042010NAV pensjonsprogrammet NTL 22042010
NAV pensjonsprogrammet NTL 22042010Dag Westhrin
 
Pensjonsreformen status mars 2011
Pensjonsreformen   status mars 2011Pensjonsreformen   status mars 2011
Pensjonsreformen status mars 2011Dag Westhrin
 
Klimavennlig Arbeidsliv - Med Kommentarer
Klimavennlig Arbeidsliv - Med KommentarerKlimavennlig Arbeidsliv - Med Kommentarer
Klimavennlig Arbeidsliv - Med KommentarerDag Westhrin
 
Ia avtalen 2010 til 2013 jl
Ia avtalen 2010 til 2013 jlIa avtalen 2010 til 2013 jl
Ia avtalen 2010 til 2013 jlDag Westhrin
 

Viewers also liked (11)

Pensjon10022010
Pensjon10022010Pensjon10022010
Pensjon10022010
 
Bureau 20091012 Nl Leukwerkt
Bureau 20091012 Nl LeukwerktBureau 20091012 Nl Leukwerkt
Bureau 20091012 Nl Leukwerkt
 
NTL Bellona Sørmarka
NTL Bellona SørmarkaNTL Bellona Sørmarka
NTL Bellona Sørmarka
 
Social Commerce App UI/UX Concept
Social Commerce App UI/UX ConceptSocial Commerce App UI/UX Concept
Social Commerce App UI/UX Concept
 
CIOForum
CIOForumCIOForum
CIOForum
 
NAV pensjonsprogrammet NTL 22042010
NAV pensjonsprogrammet NTL 22042010NAV pensjonsprogrammet NTL 22042010
NAV pensjonsprogrammet NTL 22042010
 
Pensjon10022010
Pensjon10022010Pensjon10022010
Pensjon10022010
 
Pensjonsreformen status mars 2011
Pensjonsreformen   status mars 2011Pensjonsreformen   status mars 2011
Pensjonsreformen status mars 2011
 
Klimavennlig Arbeidsliv - Med Kommentarer
Klimavennlig Arbeidsliv - Med KommentarerKlimavennlig Arbeidsliv - Med Kommentarer
Klimavennlig Arbeidsliv - Med Kommentarer
 
Csr Briefing 090910s
Csr Briefing 090910sCsr Briefing 090910s
Csr Briefing 090910s
 
Ia avtalen 2010 til 2013 jl
Ia avtalen 2010 til 2013 jlIa avtalen 2010 til 2013 jl
Ia avtalen 2010 til 2013 jl
 

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Intro to iPhone development

  • 1. an introduction to iPhone development Tobias Torrissen Know IT Objectnet
  • 3. Agenda • About the iPhone • The problem: About the example application • About the development environment • Objective C • Common API-s • XML parsing API • Core Location
  • 5.
  • 6. • 3GS • Wi-Fi (802.11b/g) • Bluetooth • Accelorometer • 600 MHz • GPU • 256 MB DRAM • A-GPS
  • 13. • Idea: let´s create an app that helps you find your way home. • [screencast]
  • 15.
  • 16. • Where am I? • What´s the address? • What is the route home? • When is the buss supposed to arrive • When does the buss actually arrive?
  • 17. • Where am I? • What´s the address? • What is the route home? • When is the buss supposed to arrive • When does the buss actually arrive?
  • 18. • Where am I? • What´s the address? • What is the route home? • When is the buss supposed to arrive • When does the buss actually arrive?
  • 20.
  • 24. reverse geocoding positioning route info realtime info
  • 26.
  • 27. • Core Location • Orientation • Acceleration • Core Animation • 3D Open GL ES • 2D Quarts • Audio playback • Video playback • Touch events • Integrated Webview • Contacts • Images • Camera • etc.
  • 28. Xcode
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 56.
  • 57.
  • 58.
  • 59.
  • 61.
  • 62. Small extention to ANSI C • About ten new reserved words • Syntactical changes influenced by SmallTalk • Used primarily by Apple. • OpenStep standard • Dynamic typing • “Explicit” memory management
  • 64. Defining interfaces @interface ClassName : SuperClassName { int count; int data; NSString* aString; } @property(nonatomic, retain) NSString* aString; - (ClassName*) initWithSome: (NSString*) value; - (void) myObjectMethod:(NSString*)paramName; + (void) myClassMethod:(NSString*)paramName; - (void) placeDocumentInQueue:(NSString) document before:(int) document after:(int) document;
  • 65. Defining classes #import "ClassName.h" @implementation SomeClass @synthesize aString; - (ClassName*) initWithSome:(NSString) value{ self = [super init]; if (self) { [self setvalue: vale]; } } - (void) myObjectMethod:(NSString*)paramName { // do stuff } + (void) myClassMethod:(NSString*)paramName{ // do stuff } - (void) placeDocument:(NSString) document InQueue:(int) queueId Before:(int) documentId after:(int) documentId { // do even more! }
  • 66. Tricky stuff Delegates When you call a API class, you often send a reference to your self or some other class which will recieve callbacks on certain events Parameters Almost named parameters, but the order is significant. Memory allocation. retain - instance counter++ release - instance counter -- [NSAutoreleasePool] - Inserted objects gets released automaticlu
  • 67. A walkthrough of the example application
  • 68. • Where am I? • What´s the address? • What is the route home? • When does the buss actually arrive?
  • 69.
  • 70. Create a project in xCode, create GUI • Write some code and connect the GUI to it • Use core location • Get some XML and parse the result
  • 72.
  • 73. •Create project •Add some controls •Run in simulator [screencast]
  • 75.
  • 76. •Connect the controls and the code •Write a simple message in the text field
  • 77. •Connect the controls and the code •Write a simple message in the text field [screencast]
  • 78.
  • 80.
  • 84. Core Location Basestasjoner CLLocation Wifi-hotspots Manager A-GPS
  • 85. Core Location Basestasjoner Objective-C CLLocation Wifi-hotspots Class Manager A-GPS
  • 86. Core Location Basestasjoner Register the class Objective-C CLLocation Wifi-hotspots Class Manager A-GPS
  • 87. Core Location Basestasjoner Register the class Start positioning Objective-C CLLocation Wifi-hotspots Class Manager A-GPS
  • 88. Core Location Basestasjoner Register the class Start positioning Objective-C CLLocation Wifi-hotspots Class Manager A-GPS
  • 89. Core Location Basestasjoner Register the class Start positioning Objective-C New position found CLLocation Wifi-hotspots Class Manager A-GPS
  • 90. Core Location Basestasjoner Register the class Start positioning Objective-C New position found CLLocation Wifi-hotspots Class Manager A-GPS
  • 91. Core Location Basestasjoner Register the class Start positioning Objective-C New position found CLLocation Wifi-hotspots Class New position found Manager A-GPS
  • 92. Core Location Basestasjoner Register the class Start positioning Objective-C New position found CLLocation Wifi-hotspots Class New position found Manager A-GPS
  • 93. Core Location Basestasjoner Register the class Start positioning Objective-C New position found CLLocation Wifi-hotspots Class New position found Manager New position found A-GPS
  • 94. Core Location Basestasjoner Register the class Start positioning Objective-C New position found CLLocation Wifi-hotspots Class New position found Manager New position found Stop positioning A-GPS
  • 95. @interface LocationController : NSObject <CLLocationManagerDelegate> { CLLocationManager *locationManager; id delegate; } @property (nonatomic, retain) CLLocationManager *locationManager; @property (nonatomic, assign) id delegate; - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation; - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error; @end
  • 96. @implementation LocationController @synthesize locationManager, delegate; // Constructor. - (id) init { self = [super init]; if (self != nil) { self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate = self; // send loc updates to myself } return self; } // Called when the locationmanager finds a new update on posission - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { [self.delegate locationUpdate:newLocation]; } // Called if an error occurs. - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { [self.delegate locationError:error]; } // free the memory - (void)dealloc { [self.locationManager release]; [super dealloc]; } @end
  • 97. [..] locationController = [[LocationController alloc]init]; locationController.delegate = self; [..] [locationController.locationManager startUpdatingLocation]; [..] - (void)locationUpdate:(CLLocation *)location { myTextField.text = [location description]; [locationController.locationManager stopUpdatingLocation]; } - (void)locationError:(NSError *)error { myTextField.text = [error description]; }
  • 99. XML parsing Event based XML parsing: - (void)parser:(NSXMLParser *)parser didStartElement: (NSString *)elementName - (void)parser:(NSXMLParser *)parser foundCharacters: (NSString *)string - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName - (void)parserDidEndDocument:(NSXMLParser *)parser
  • 100. <DISMessages SubscriptionID="1"> <DISDeviation TimeStamp="2009-04-27T13:17:10.201+02:00"> <DISID>Stortinget</DISID> <LineID>3</LineID> <DestinationStop>Mortensrud</DestinationStop> <ScheduledDISArrivalTime>2009-04-27T13:40:30.000+02:00<ScheduledDISArrivalTime> <ExpectedDISArrivalTime>2009-04-27T13:40:55.000+02:00</ExpectedDISArrivalTime> </DISDeviation> <DISDeviation TimeStamp="2009-04-27T13:17:10.201+02:00"> <DISID>Stortinget</DISID> <LineID>4</LineID> <DestinationStop>Bergkrystallen</DestinationStop> <ScheduledDISArrivalTime>2009-04-27T13:42:30.000+02:00</ScheduledDISArrivalTime> <ExpectedDISArrivalTime>2009-04-27T13:45:55.000+02:00</ExpectedDISArrivalTime> </DISDeviation> </DISMessages>
  • 101. // // ArrivalInfo.h // rOOts2 // // Created by Tobias K Torrissen on 4/27/09. // Copyright 2009 __MyCompanyName__. All rights reserved. // #import <Foundation/Foundation.h> @interface ArrivalInfo : NSObject { NSString *DestinationStop; NSString *ExpectedDISArrivalTime; NSString *ScheduledDISArrivalTime; NSString *LineID; } @property(nonatomic, retain) NSString *ExpectedDISArrivalTime; @property(nonatomic, retain) NSString *ScheduledDISArrivalTime; @property(nonatomic, retain) NSString *LineID; @property(nonatomic, retain) NSString *DestinationStop; @end
  • 102. // // ArrivalInfo.m // rOOts2 // // Created by Tobias K Torrissen on 4/27/09. // Copyright 2009 __MyCompanyName__. All rights reserved. // #import "ArrivalInfo.h" @implementation ArrivalInfo @synthesize DestinationStop, ExpectedDISArrivalTime, ScheduledDISArrivalTime, LineID; - (void) dealloc { [DestinationStop release]; [ExpectedDISArrivalTime release]; [ScheduledDISArrivalTime release]; [LineID release]; [super dealloc]; } @end
  • 103. #import <Foundation/Foundation.h> #import "ArrivalInfo.h" #import "ROOts2AppDelegate.h" @interface RealTimeParser : NSObject { ArrivalInfo *currentArrivalInfo; NSMutableString *valueInProgress; rOOts2AppDelegate *delegate; } - (RealTimeParser *) initRealTimeParser; @end
  • 104. // called whenever an start element is reached. - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if([elementName isEqual:@"DISMessage"]){ NSLog(@"start dataset"); currentArrivalInfo = [[ArrivalInfo alloc]init]; } } // save the actual value... - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if(!valueInProgress) valueInProgress = [[NSMutableString alloc] initWithString:string]; else [valueInProgress appendString:string]; } // when ever you reach a end document tag. - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if([elementName isEqualToString:@"DISDeviation"]) { NSLog(@"Adding travel info to deligate"); [delegate.records addObject:currentArrivalInfo]; [currentArrivalInfo release]; currentArrivalInfo = nil; } else if ([elementName isNotEqualTo:@"DISMessages"]) { [currentArrivalInfo setValue:valueInProgress forKey:elementName]; NSLog(@"Adding key, value %@, %@ n", elementName, valueInProgress); } [valueInProgress release]; valueInProgress = nil; }
  • 105. NSURL *url = [[NSURL alloc] initWithString:@"http:// www.sis.trafikanten.no:8088/xmlrtpi/dis/request?DISID=SN $03011330"]; NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url]; RealTimeParser *parser = [[RealTimeParser alloc] initRealTimeParser]; [xmlParser setDelegate:parser]; BOOL success = [xmlParser parse]; if(success) NSLog(@"No Errors"); else NSLog(@"Error Error Error!!!");
  • 106. How to get into iPhone development
  • 107.
  • 108. • You need to register...
  • 109. • You need to register... • Apple ID
  • 110. • You need to register... • Apple ID • iPhone Developer
  • 111. • You need to register... • Apple ID • iPhone Developer • iPhone Developer Program
  • 112.
  • 113. Personal • 99$ • can distribute through appstore
  • 114. Personal • 99$ • can distribute through appstore • Enterprise • 299$ • can not distribute through appstore
  • 115.
  • 116. ?
  • 117. well... ?
  • 118. well... ? • The phone is amazing.
  • 119. well... ? • The phone is amazing. • Xcode is OK
  • 120. well... ? • The phone is amazing. • Xcode is OK • The politics are mindboggeling
  • 121. well... ? • The phone is amazing. • Xcode is OK • The politics are mindboggeling • Look out for Android
  • 122.
  • 123. News in iPhone 3.0 • peer-to-peer connections over Bonjour; • an app interface for hardware accessories; • access to the iPod music library; • a new Maps API • long-awaited push notification support. • API for streaming audio and video directly over HTTP • control of the proximity sensor • audio recording features • a battery API
  • 124.
  • 127. NSMutableURLRequest *theRequest = [[NSMutableURLRequest alloc] init]; NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]]; [theRequest setURL:[NSURL URLWithString:@"http://service-test.1881.no/SearchService/v4_2/SearchService.asmx"]]; [theRequest setHTTPMethod:@"POST"]; [theRequest setValue: msgLength forHTTPHeaderField:@"Content-Length"]; [theRequest setValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [theRequest setValue: @"http://Opplysningen.WebService.SearchService/2006/10/MultiSearchSingleResult" forHTTPHeaderField:@"SOAPAction"]; [theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if(connection) { webData = [[NSMutableData data] retain]; } else { NSLog(@"ERROR with connection"); } [theRequest release]; } -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [webData setLength:0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data { [webData appendData: data]; } -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { NSLog(@"ERROR with the connection"); [spinner stopAnimating]; [connection release]; [webData release]; [query release]; } -(void)connectionDidFinishLoading:(NSURLConnection *) connection { NSLog(@"DONE loading. Recieved BYTES: %d", [webData length]);
  • 128. NSString *soapMessage = [NSString stringWithFormat: @"<?xml version="1.0" encoding="utf-8"?>n" "<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/ XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">n" "<soap:Body>n" "<MultiSearchSingleResult xmlns="http://Opplysningen.WebService.SearchService/2006/10">n" "<MultiSearchRequest>n" "<GetAdvertisements>false</GetAdvertisements>n" "<ResponseType>None</ResponseType>n" "<PageSize>20</PageSize>n" "<Offset>0</Offset>n" "<SearchQuery>%@</SearchQuery>n" "<PartnerGuid>20ecc3d7-8057-4512-8aab-e3bf55470333</PartnerGuid>n" "<MultiSearchFilter>n" "<GetPersonSearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</ GetPersonSearch>n" "<GetAddressSearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</ GetAddressSearch>n" "<GetCompanySearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</ GetCompanySearch>n" "<GetBusinessSearch xmlns="http://Opplysningen.WebService.SearchService.DataTypes/2006/10">true</ GetBusinessSearch>n" "</MultiSearchFilter>n" "<DetailLevel>Basic</DetailLevel>n" "<RequireMapCoordinates>false</RequireMapCoordinates>n" "</MultiSearchRequest>n" "</MultiSearchSingleResult>n" "</soap:Body>n" "</soap:Envelope>n", query];

Editor's Notes

  1. Splashscreen som er oppe mens vi venter p&amp;#xE5; at alle setter seg ned. Start opp firefox i bakgrunnen. Skru av lyden og telefonen. Det h&amp;#xE6;r f&amp;#xE5;redraget handler om utvikling for iphone. VI kommer innom en del ulike teknologier i l&amp;#xF8;pet av de neste 40 minuttan. P&amp;#xE5; sluttn av foredraget har vi litt tid till sp&amp;#xF8;rsm&amp;#xE5;l.
  2. Litt om megselv. Tobias K Torrissen Jobbet med programmering og systemutvikling i 11 &amp;#xE5;r, Cand.Scient fra UIO Kommer fra Oslo CTO og konsulent Jobbet mye med store mellomvaresystemer.
  3. Here
  4. Sold over 12 million devices world wide. Second largest smartphone vendor in the world 7th largest phone vendor in the world 1 000 000 000 (billon) downloads from the appstore. 25 000 apps available throug appstore in 9 months.
  5. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  6. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  7. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  8. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  9. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  10. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  11. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  12. top-of-the-line hjemmepc var for 7-8 &amp;#xE5;r siden Iphone sin skjerm er er ca 9 cm stor og har en oppl&amp;#xF8;sning p&amp;#xE5; 480x320 pixels GPU:en trengs For &amp;#xE5; kunne st&amp;#xF8;tte Open GL ES Alt i alt: En kjempespennende maskin &amp;#xE5; jobbe med!! appstore, en genial distribusjonsmekanisme for 3:e parts applikasjoner
  13. This is me, when I
  14. This is me, when I
  15. This is me, when I
  16. This is me, when I
  17. This is me, when I
  18. This is me, when I
  19. This is me, when I
  20. This is me, when I
  21. This is me, when I
  22. This is me, when I
  23. This is me, when I
  24. This is me, when I
  25. This is me, when I
  26. This is me, when I
  27. This is me, when I
  28. This is me, when I
  29. This is me, when I
  30. This is me, when I
  31. This is me, when I
  32. This is me, when I
  33. This is me, when I
  34. This is me, when I
  35. This is me, when I
  36. This is me, when I
  37. This is me, when I
  38. This is me, when I
  39. This is me, when I
  40. This is me, when I
  41. This is me, when I
  42. This is me, when I
  43. This is me, when I
  44. La oss se litt n&amp;#xE6;rmere p&amp;#xE5; appen. [kj&amp;#xF8;r film] Snakk deg gjennom applikasjonen. (Ikke fortell hvilke tjenester som blir brukt)
  45. F&amp;#xF8;r vi g&amp;#xE5;r konkret til verks er det greit &amp;#xE5; se hvilke delproblemer vi identifiserte. Hva var det vi m&amp;#xE5;tte f&amp;#xE5; p&amp;#xE5; plass.
  46. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon
  47. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon
  48. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon
  49. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon
  50. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon
  51. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon
  52. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon
  53. Tobias: N&amp;#xE5; skal vi g&amp;#xE5; gjennom hvordan denne applikasjonen er bygget opp.
  54. vi benytter oss av 2 velkjente webtjenester: google maps som gir oss en adresse gitt en posisjon. trafikanten ger oss ruta hjem og informasjon om n&amp;#xE5;r linjene g&amp;#xE5;r, (i realtid) I tillegg bruke vi lokaliseringsfunktionen i iPhone for &amp;#xE5; f&amp;#xE5; posisjonering (klikk) noen av disse webtjenestene mangler gode programatiske API:er VI bruker Yahoo pipes for &amp;#xE5; f&amp;#xE5; ut dataen vi &amp;#xF8;nsker i XML format. La oss g&amp;#xE5; litt n&amp;#xE6;rmere in p&amp;#xE5; hver enkelt komponent
  55. vi benytter oss av 2 velkjente webtjenester: google maps som gir oss en adresse gitt en posisjon. trafikanten ger oss ruta hjem og informasjon om n&amp;#xE5;r linjene g&amp;#xE5;r, (i realtid) I tillegg bruke vi lokaliseringsfunktionen i iPhone for &amp;#xE5; f&amp;#xE5; posisjonering (klikk) noen av disse webtjenestene mangler gode programatiske API:er VI bruker Yahoo pipes for &amp;#xE5; f&amp;#xE5; ut dataen vi &amp;#xF8;nsker i XML format. La oss g&amp;#xE5; litt n&amp;#xE6;rmere in p&amp;#xE5; hver enkelt komponent
  56. vi benytter oss av 2 velkjente webtjenester: google maps som gir oss en adresse gitt en posisjon. trafikanten ger oss ruta hjem og informasjon om n&amp;#xE5;r linjene g&amp;#xE5;r, (i realtid) I tillegg bruke vi lokaliseringsfunktionen i iPhone for &amp;#xE5; f&amp;#xE5; posisjonering (klikk) noen av disse webtjenestene mangler gode programatiske API:er VI bruker Yahoo pipes for &amp;#xE5; f&amp;#xE5; ut dataen vi &amp;#xF8;nsker i XML format. La oss g&amp;#xE5; litt n&amp;#xE6;rmere in p&amp;#xE5; hver enkelt komponent
  57. vi benytter oss av 2 velkjente webtjenester: google maps som gir oss en adresse gitt en posisjon. trafikanten ger oss ruta hjem og informasjon om n&amp;#xE5;r linjene g&amp;#xE5;r, (i realtid) I tillegg bruke vi lokaliseringsfunktionen i iPhone for &amp;#xE5; f&amp;#xE5; posisjonering (klikk) noen av disse webtjenestene mangler gode programatiske API:er VI bruker Yahoo pipes for &amp;#xE5; f&amp;#xE5; ut dataen vi &amp;#xF8;nsker i XML format. La oss g&amp;#xE5; litt n&amp;#xE6;rmere in p&amp;#xE5; hver enkelt komponent
  58. Tobias: Lansert 6 mars 2008 Samme sdk som utviklerne p&amp;#xE5; apple jobber med Programmering I Objective C (Klassisk C med noen utvidelser for &amp;#xE5; st&amp;#xF8;tte objektorientering) SDK:en best&amp;#xE5;r av (klikk)
  59. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  60. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  61. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  62. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  63. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  64. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  65. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  66. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  67. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  68. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  69. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  70. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  71. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  72. Tobias en rekke bibliotek La oss se litt p&amp;#xE5; utviklings milj&amp;#xF8;et.
  73. Tobias SDK:n inneh&amp;#xE5;ller et relativt sofistikert utviklingsmilj&amp;#xF8; Xcode er det samme utviklingsmilj&amp;#xF8;et som man jobber med n&amp;#xE5;r man lager native osx applikasjoner Apple har naturlig nokk valgt gjenbruke milj&amp;#xF8;et for utvikling av iphone applikasjoner
  74. Tobias Dette kan jo virke litt kaosarted, men xcode er ett moderne IDE med flusst av tjenester. N&amp;#xE5;r du blir vant med xcode, s&amp;#xE5; virker det mye greiere en ved f&amp;#xF8;rste &amp;#xF8;yekast. La oss se litt p&amp;#xE5; de ulike features:ene (klick) Code Highlight SYntax coloring Code completion
  75. Tobias Integrated dokumentasjon som er kontext avhengig.
  76. Tobias INtegrert subversion for versionshantering av prosjektfiler (fungerer bra) Subversion, CVS
  77. Tobias oversiktlig prosjekthentering
  78. G&amp;#xE5; fort over til neste!!
  79. Roger: Mulighet &amp;#xE5; bruke en rekke standard gui komponenter som vi kjenner igjen fra de innebygde applikasjonene p&amp;#xE5; iphone
  80. Roger: Skaper grensesnittet gjennom drag n drop
  81. Roger: Gode muligheter for &amp;#xE5; definere layout for hver enkelt komponent
  82. Roger: Gui:et kobles med drag n drop til en klasse som agerer gui-driver
  83. Roger: Denne er gull vert n&amp;#xE5;r du utvikler iphone appen din lar deg teste og eventuellt debugge koden din i ett simulert iphone milj&amp;#xF8; n&amp;#xE5;r alt kommer til allt s&amp;#xE5; viser det seg att det finns ganske store forskjeller mellom simulatorn og selve iphonen, s&amp;#xE5; du m&amp;#xE5; belage deg p&amp;#xE5; &amp;#xE5; debugge mot iphonen ogs&amp;#xE5;
  84. Roger: En virtuell instanse av iphonen till &amp;#xE5; pr&amp;#xF8;ve koden din p&amp;#xE5;, uten noe ventetid.
  85. Roger: Mulighet til &amp;#xE5; aktivere breakpoints i koden slik at du kan kj&amp;#xF8;re step-by-step debugging av ditt program. Her har man ogs&amp;#xE5; mulighet til &amp;#xE5; granske objekt. Gre oversikt over ulike tr&amp;#xE5;der
  86. Roger: Egen innebygged GDB terminal
  87. Roger: Mulighet til &amp;#xE5; granske minnet
  88. Roger: N&amp;#xE5;r man har funnet alle buggene som gj&amp;#xF8;r at programmet crasher, s&amp;#xE5; m&amp;#xE5; man finne andre brister. Dette har apple gjort veldig lett for oss gjennom instruments. avansert profileringsverk&amp;#xF8;y viser minneslekasjer (tru meg de finns) code hot spots object allocations etc
  89. Roger: klikk forslag til ulike m&amp;#xE5;linger
  90. Her har vi en kj&amp;#xF8;ring vi har gjort p&amp;#xE5; v&amp;#xE5;r app. Minneallokering minnelekasjer netverksaktivitet bruk av internminne bruk av cpu Du har mulighet till &amp;#xE5; spare ett eget oppsett av m&amp;#xE5;lere DU har ogs&amp;#xE5; mulighet til &amp;#xE5; spare en kj&amp;#xF8;ring
  91. Categories are extentions to classes without subclassing. It can also be used to distribute a class implementation over several source files.
  92. Categories are extentions to classes without subclassing. It can also be used to distribute a class implementation over several source files.
  93. Categories are extentions to classes without subclassing. It can also be used to distribute a class implementation over several source files.
  94. Categories are extentions to classes without subclassing. It can also be used to distribute a class implementation over several source files.
  95. Categories are extentions to classes without subclassing. It can also be used to distribute a class implementation over several source files.
  96. Categories are extentions to classes without subclassing. It can also be used to distribute a class implementation over several source files.
  97. Categories are extentions to classes without subclassing. It can also be used to distribute a class implementation over several source files.
  98. access is not show here. Default is protected @private @public @protected
  99. When countere reaches 0, dealloc is called.
  100. Dette er ikke en enkelt system. Skulle vi ha implementert dette fra scratch m&amp;#xE5;tte vi ha laget oss et internt adresseregister som mapper fra koordinater til adresser og dessuten m&amp;#xE5;tte vi jo p&amp;#xE5; en eller annen m&amp;#xE5;te ha skaffet oss oversikt over rutetider og sanntidsinformasjon Vi har defor valgt i bruke en teknikk / konsept som heter mashups. [KLIKK]
  101. Vi begynner med lokaliseringen. Hvor er jeg? Rammeverket som kan gi oss svaret heter Core Location (click) Kanske den heteste tjenesten p&amp;#xE5; iphonen, etterlengtet blant utviklere for mobile platformer
  102. Core Location bruker flere ulike teknologier Wifi hotspots: wifi-hotspots vet posisjon og rekkevidde Basestasjoner: Telefonen din er knyttet til en basestasjon, basestasjonen vet sin egen posisjon &amp;#xE5; rekkevidde. A-GPS: vangli GPS er for tregt og str&amp;#xF8;mkrevende p&amp;#xE5; grund av krevende beregninger. For at dette skal virke m&amp;#xE5; man v&amp;#xE6;re tilknyttet en basestasjon som st&amp;#xF8;tter A-GPS. AGPS flytter de tyngste beregningene ut till basestasjonene Core lokation er grejt &amp;#xE5; jobbe med, la oss se litt p&amp;#xE5; hvordan vi f&amp;#xE5;r ut posisjonen i v&amp;#xE5;rt program
  103. Core Location bruker flere ulike teknologier Wifi hotspots: wifi-hotspots vet posisjon og rekkevidde Basestasjoner: Telefonen din er knyttet til en basestasjon, basestasjonen vet sin egen posisjon &amp;#xE5; rekkevidde. A-GPS: vangli GPS er for tregt og str&amp;#xF8;mkrevende p&amp;#xE5; grund av krevende beregninger. For at dette skal virke m&amp;#xE5; man v&amp;#xE6;re tilknyttet en basestasjon som st&amp;#xF8;tter A-GPS. AGPS flytter de tyngste beregningene ut till basestasjonene Core lokation er grejt &amp;#xE5; jobbe med, la oss se litt p&amp;#xE5; hvordan vi f&amp;#xE5;r ut posisjonen i v&amp;#xE5;rt program
  104. Core Location bruker flere ulike teknologier Wifi hotspots: wifi-hotspots vet posisjon og rekkevidde Basestasjoner: Telefonen din er knyttet til en basestasjon, basestasjonen vet sin egen posisjon &amp;#xE5; rekkevidde. A-GPS: vangli GPS er for tregt og str&amp;#xF8;mkrevende p&amp;#xE5; grund av krevende beregninger. For at dette skal virke m&amp;#xE5; man v&amp;#xE6;re tilknyttet en basestasjon som st&amp;#xF8;tter A-GPS. AGPS flytter de tyngste beregningene ut till basestasjonene Core lokation er grejt &amp;#xE5; jobbe med, la oss se litt p&amp;#xE5; hvordan vi f&amp;#xE5;r ut posisjonen i v&amp;#xE5;rt program
  105. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  106. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  107. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  108. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  109. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  110. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  111. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  112. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  113. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  114. Roger Core location er ett stort rammeverk CLLocationManager er interfacet (klikk klikk klikk) Kan nevne at: Posisjoner inneholder, nuverende posisjon, forrige m&amp;#xE5;lte posisjon, accuracy, h&amp;#xF8;jde over havet etc.
  115. So, the iPhone SDK provides only one XML parser It is event driven. When ever you for instance reach a tag, an event will fire and you can act accordingly You can not go back in the document. OpenSOurce alternatives are available if you need to have the whole document in memory.
  116. This is the domain object for travel info, basicly the information we are interested in.
  117. Here is the implementation. Basicly nothing else than the free up the memory and the generation of properties.
  118. Apple ID registrering p&amp;#xE5; apple. iPhone developer - tilgang til SDK osv iPhone developer program - tilgang til appstore
  119. Apple ID registrering p&amp;#xE5; apple. iPhone developer - tilgang til SDK osv iPhone developer program - tilgang til appstore
  120. Apple ID registrering p&amp;#xE5; apple. iPhone developer - tilgang til SDK osv iPhone developer program - tilgang til appstore
  121. Apple ID registrering p&amp;#xE5; apple. iPhone developer - tilgang til SDK osv iPhone developer program - tilgang til appstore
  122. You have to have a mac. When the phone fis Apple har l&amp;#xF8;snet litt i det siste. Simulator vs Emulator Late som vs kopiere. (Android er java... Eksakt kopi er mulig)
  123. You have to have a mac. When the phone fis Apple har l&amp;#xF8;snet litt i det siste. Simulator vs Emulator Late som vs kopiere. (Android er java... Eksakt kopi er mulig)
  124. You have to have a mac. When the phone fis Apple har l&amp;#xF8;snet litt i det siste. Simulator vs Emulator Late som vs kopiere. (Android er java... Eksakt kopi er mulig)
  125. You have to have a mac. When the phone fis Apple har l&amp;#xF8;snet litt i det siste. Simulator vs Emulator Late som vs kopiere. (Android er java... Eksakt kopi er mulig)
  126. You have to have a mac. When the phone fis Apple har l&amp;#xF8;snet litt i det siste. Simulator vs Emulator Late som vs kopiere. (Android er java... Eksakt kopi er mulig)
  127. You have to have a mac. When the phone fis Apple har l&amp;#xF8;snet litt i det siste. Simulator vs Emulator Late som vs kopiere. (Android er java... Eksakt kopi er mulig)
  128. So, our software is not released. We just did it for fun. But some guys in a company called shortcuts have released an app that gives you location based realtime info. Try it out i you are in Oslo.
  129. Bonjour is a service discovery protocol
  130. Sp&amp;#xF8;rsm&amp;#xE5;l? OCUnit - unittesting.