developing iphone applications in .net - march 16 sdc2010

46
Paul Rayner AGILITY. CRAFT. ARCHITECTURE. Developing iPhone Applications in Tuesday, March 16, 2010

Upload: paul-rayner

Post on 28-Jan-2015

107 views

Category:

Technology


0 download

DESCRIPTION

iPhone development opens up a world of opportunities for developers that invest the time to learn this exciting platform. And Monotouch allows developers to create C# and .NET-based applications that run on the iPhone while taking advantage of the iPhone API’s and their existing libraries and skills.Experience a quick start to iPhone application development using the language and libraries that you are already familiar with, and prepare to learn something new about how to use what the iPhone API’s have to offer. Gain a solid understanding of the basics of iPhone development in .NET, and get up and running quickly building the next killer iPhone app.

TRANSCRIPT

Page 1: Developing iPhone Applications In .Net - March 16 SDC2010

Paul  Rayner

AGILITY.  CRAFT.  ARCHITECTURE.

Developing iPhone Applications in

Tuesday, March 16, 2010

Page 2: Developing iPhone Applications In .Net - March 16 SDC2010

Why theiPhone?

Tuesday, March 16, 2010

Page 3: Developing iPhone Applications In .Net - March 16 SDC2010

Why theiPhone?

Tuesday, March 16, 2010

Page 4: Developing iPhone Applications In .Net - March 16 SDC2010

Tools

Tuesday, March 16, 2010

Page 5: Developing iPhone Applications In .Net - March 16 SDC2010

Distributing AppsTuesday, March 16, 2010

Page 6: Developing iPhone Applications In .Net - March 16 SDC2010

Tuesday, March 16, 2010

Page 7: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Tools

Tuesday, March 16, 2010

Page 8: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Tools

Tuesday, March 16, 2010

Page 9: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Tools

Tuesday, March 16, 2010

Page 10: Developing iPhone Applications In .Net - March 16 SDC2010

Demo :: Getting Started

Tuesday, March 16, 2010

Page 11: Developing iPhone Applications In .Net - March 16 SDC2010

Demo :: Getting Started

Tuesday, March 16, 2010

Page 12: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone Constraints

Tuesday, March 16, 2010

Page 13: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone Constraints

•iPhone  apps  are  not  small  desktop  apps

Tuesday, March 16, 2010

Page 14: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone Constraints

•iPhone  apps  are  not  small  desktop  apps•Limited  resources

Tuesday, March 16, 2010

Page 15: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone Constraints

•iPhone  apps  are  not  small  desktop  apps•Limited  resources•Different  usage  pa8erns

Tuesday, March 16, 2010

Page 16: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone Constraints

•iPhone  apps  are  not  small  desktop  apps•Limited  resources•Different  usage  pa8erns•Only  one  applica;on  can  run  at  a  ;me

Tuesday, March 16, 2010

Page 17: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone Constraints

•iPhone  apps  are  not  small  desktop  apps•Limited  resources•Different  usage  pa8erns•Only  one  applica;on  can  run  at  a  ;me•Handle  device  differences  gracefully

Tuesday, March 16, 2010

Page 18: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone Constraints

•iPhone  apps  are  not  small  desktop  apps•Limited  resources•Different  usage  pa8erns•Only  one  applica;on  can  run  at  a  ;me•Handle  device  differences  gracefully•Devs:  No  JIT  compila;on,  no  scrip;ng

Tuesday, March 16, 2010

Page 19: Developing iPhone Applications In .Net - March 16 SDC2010

Cocoa & Objective-C

Text

! NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://virtualgenius:[email protected]/statuses/update.xml"]! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! cachePolicy:NSURLRequestUseProtocolCachePolicy! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! timeoutInterval:60.0];! [theRequest setHTTPMethod:@"POST"];! [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]];! NSURLResponse* response;! NSError* error;! NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];! NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]);

Tuesday, March 16, 2010

Page 20: Developing iPhone Applications In .Net - March 16 SDC2010

Text

! NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://virtualgenius:[email protected]/statuses/update.xml"]! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! cachePolicy:NSURLRequestUseProtocolCachePolicy! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! timeoutInterval:60.0];! [theRequest setHTTPMethod:@"POST"];! [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]];! NSURLResponse* response;! NSError* error;! NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];! NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]);

Cocoa & Objective-C

Tuesday, March 16, 2010

Page 21: Developing iPhone Applications In .Net - March 16 SDC2010

! NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://virtualgenius:[email protected]/statuses/update.xml"]! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! cachePolicy:NSURLRequestUseProtocolCachePolicy! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! timeoutInterval:60.0];! [theRequest setHTTPMethod:@"POST"];! [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]];! NSURLResponse* response;! NSError* error;! NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];! NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]);

Cocoa & Objective-C

Tuesday, March 16, 2010

Page 22: Developing iPhone Applications In .Net - March 16 SDC2010

! NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://virtualgenius:[email protected]/statuses/update.xml"]! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! cachePolicy:NSURLRequestUseProtocolCachePolicy! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! timeoutInterval:60.0];! [theRequest setHTTPMethod:@"POST"];! [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]];! NSURLResponse* response;! NSError* error;! NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];! NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]);

Cocoa & Objective-C•When  there  is  no  more  memory,  there  is  no  more  memory

Tuesday, March 16, 2010

Page 23: Developing iPhone Applications In .Net - March 16 SDC2010

! NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://virtualgenius:[email protected]/statuses/update.xml"]! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! cachePolicy:NSURLRequestUseProtocolCachePolicy! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! timeoutInterval:60.0];! [theRequest setHTTPMethod:@"POST"];! [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]];! NSURLResponse* response;! NSError* error;! NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];! NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]);

Cocoa & Objective-C•When  there  is  no  more  memory,  there  is  no  more  memory•No  automa3c  objects  on  the  stack.

Tuesday, March 16, 2010

Page 24: Developing iPhone Applications In .Net - March 16 SDC2010

! NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://virtualgenius:[email protected]/statuses/update.xml"]! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! cachePolicy:NSURLRequestUseProtocolCachePolicy! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! timeoutInterval:60.0];! [theRequest setHTTPMethod:@"POST"];! [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]];! NSURLResponse* response;! NSError* error;! NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];! NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]);

Cocoa & Objective-C•When  there  is  no  more  memory,  there  is  no  more  memory•No  automa3c  objects  on  the  stack.•No  garbage  collector  (manual  memory  management)

Tuesday, March 16, 2010

Page 25: Developing iPhone Applications In .Net - March 16 SDC2010

! NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://virtualgenius:[email protected]/statuses/update.xml"]! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! cachePolicy:NSURLRequestUseProtocolCachePolicy! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! timeoutInterval:60.0];! [theRequest setHTTPMethod:@"POST"];! [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]];! NSURLResponse* response;! NSError* error;! NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];! NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]);

Cocoa & Objective-C•When  there  is  no  more  memory,  there  is  no  more  memory•No  automa3c  objects  on  the  stack.•No  garbage  collector  (manual  memory  management)

Tuesday, March 16, 2010

Page 26: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Limitations

Tuesday, March 16, 2010

Page 27: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Limitations

•No  JIT  or  scrip3ng

Tuesday, March 16, 2010

Page 28: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Limitations

•No  JIT  or  scrip3ng•No  code  gen  at  run3me

Tuesday, March 16, 2010

Page 29: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Limitations

•No  JIT  or  scrip3ng•No  code  gen  at  run3me

System.Reflec3on.Emit  not  available

Tuesday, March 16, 2010

Page 30: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Limitations

•No  JIT  or  scrip3ng•No  code  gen  at  run3me

System.Reflec3on.Emit  not  availableNo  support  for  System.Run3me.Remo3ng

Tuesday, March 16, 2010

Page 31: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Limitations

•No  JIT  or  scrip3ng•No  code  gen  at  run3me

System.Reflec3on.Emit  not  availableNo  support  for  System.Run3me.Remo3ngNo  support  for  DLR  languages  (eg.  IronRuby,  IronPython)

Tuesday, March 16, 2010

Page 32: Developing iPhone Applications In .Net - March 16 SDC2010

MonoTouch Limitations

•No  JIT  or  scrip3ng•No  code  gen  at  run3me

System.Reflec3on.Emit  not  availableNo  support  for  System.Run3me.Remo3ngNo  support  for  DLR  languages  (eg.  IronRuby,  IronPython)See  hJp://monotouch.net/Documenta3on/Limita3ons

Tuesday, March 16, 2010

Page 33: Developing iPhone Applications In .Net - March 16 SDC2010

Sample App Walkthrough

Tuesday, March 16, 2010

Page 34: Developing iPhone Applications In .Net - March 16 SDC2010

What’s Next?

15

Tuesday, March 16, 2010

Page 35: Developing iPhone Applications In .Net - March 16 SDC2010

What’s Next?

15

Tuesday, March 16, 2010

Page 36: Developing iPhone Applications In .Net - March 16 SDC2010

What’s Next?

15

Tuesday, March 16, 2010

Page 37: Developing iPhone Applications In .Net - March 16 SDC2010

What’s Next?

15

Tuesday, March 16, 2010

Page 38: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone  development  is  

challenging

Tuesday, March 16, 2010

Page 39: Developing iPhone Applications In .Net - March 16 SDC2010

iPhone  development  is  

challenging

MonoTouch  ==    GoodnessTuesday, March 16, 2010

Page 40: Developing iPhone Applications In .Net - March 16 SDC2010

Questions

Tuesday, March 16, 2010

Page 41: Developing iPhone Applications In .Net - March 16 SDC2010

Resources

Tuesday, March 16, 2010

Page 42: Developing iPhone Applications In .Net - March 16 SDC2010

Resources

Tuesday, March 16, 2010

Page 43: Developing iPhone Applications In .Net - March 16 SDC2010

Resources

Tuesday, March 16, 2010

Page 44: Developing iPhone Applications In .Net - March 16 SDC2010

Resources

http://delicious.com/virtualgenius/monotouchTuesday, March 16, 2010

Page 46: Developing iPhone Applications In .Net - March 16 SDC2010

References• http://www.amazon.com/Building-iPhone-Applications-Developer-

MonoTouch/dp/B003A6RCF2• iPhone image: http://ke2yk.wordpress.com/2009/03/22/first-it-was-cw-

now-its-the-question-pool/• iPhone sales chart: http://en.wikipedia.org/wiki/IPhone • Monotouch home page: http://monotouch.net/• MacBook Pro: http://www.apple.com/macbookpro/• iPhone Dev Center Logo: http://developer.apple.com/iphone/index.action • Mono logo: www.mono-project.net• Objective C memory management: http://cocoadevcentral.com/d/

learn_objectivec/ • Microphone: http://www.faqs.org/photo-dict/phrase/377/microphone.html• App store logo: http://www.apple.com/iphone/apps-for-iphone/• Android developer logo: http://developer.android.com/index.html• Head First iPhone Development: http://oreilly.com/catalog/9780596803551

Tuesday, March 16, 2010