Upload
sampetruda
View
762
Download
0
Tags:
Embed Size (px)
Citation preview
Wallace B. (Wally) McClure
Who the heck am I?“Building iPhone Apps for the .NET
Developer”Ebook – downloadable today.Print book in July, 2010.
“Beginning AJAX with ASP.NET”“Beginning ASP.NET 2.0 AJAX”“Professional ASP.NET 3.5 Service Pack
1”MVP – ASP.NET.ASPInsider.ASP.NET Podcast.INETA Speaker’s Bureau.
My Mileage May Vary during the talk.• MonoTouch/Mono/MonoDevelop are
released products.• Alpha/Beta Code on my system.
– iPhone SDK 3.2 Beta.– MonoTouch 1.9.5 Alpha.– MonoDevelop 2.2.1.Beta.
Where are we at?Increasingly mobile.Laptops are not quite convenient.Power management is important.Wifi is not everywhere.iPhone has tremendous
mindshare/marketshare..NET Framework is the most popular
development framework.
Why Develop for the iPhone?
History2007 – iPhone introduced – web applications.2008 – iPhone 3g introduced – web and app.2009 – iPhone 3gs introduced – web , app,
and iPhone 3.0 operating system.2010 – iPad introduced.Apple is the #3 smart phone providers
(Symbian & RIM).“There’s an app for that!”
Strategies to get on the iPhoneWeb application.Objective-C.PhoneGap.MonoTouch.Others.
Why Develop with MonoTouch?iPhone.
MindShare.MarketShare.
.NET MarketShare.Existing Knowledge.
MonoCross Platform.Maturity.
What is MonoTouch?Mono – Open Source implementation of .NET.MonoTouch is a .NET/c# layer over
CocoaTouch.MonoDevelop – IDE.Interface Builder – Design Surface.CocoaTouch.Apple SDK.AOT Compilation.
What MonoTouch is NotNot Winforms/WPF on the iPhone.Not a plugin to Visual Studio.“.NET is (Southern)American English.
MonoTouch is British English. C# is the common bond to learn the customs (programming idiosyncracies) of the iPhone.”
Editions“Community”
Free.SimulatorCan’t deploy to device.
Single User.Enterprise.
Mono’s JIT Engine
CILCILCILCIL
MonoMonoMonoMono
MemoMemoryryMemoMemoryry
Apple No No...Contractual Requirements
No interpreted codeNo shared libraries
Kernel LimitationsiPhone OS 2.0+ disables JIT
Mono’s AOT Engine
CILCILCILCIL
Mono Mono
AOTAOTMono Mono
AOTAOT Mono Mono RuntimeRuntimeMono Mono RuntimeRuntime
ARMARMARMARM
Native Native CodeCodeNative Native CodeCode
Monotouch FeaturesMonoDevelop iPhone Add-InCocoaTouch.NETFull static AOT compilerSupport for existing code
GenericsLINQMany .NET features.
Get StartedHello World.
Learn to read Objective-C
•All Apple documentation is in Obj-C
•Most examples are in Obj-C
•It’s not too hard to understand
•It might even be fun...
MonoTouch’s APIs
The BindingsMonoTouch namespaceMonoTouch.Foo namespace
Maps to CocoaTouch’s Foo Framework1:1 Mapping of classes.
MonoTouch.UIKit.UILabelCocoaTouch’s UIKit framework,
UILabel class
Strong TypesObjective-C
Arrays are weakly typed:NSArray return values.
MonoTouch has strong typesUIView[] Subviews { get; }vsNSArray *subviews;
Intellisense - explore the API...
Garbage CollectionAutomatic:
Mono’s GC will collect objects on demand
Deterministic:
Use when you need control.
Every object in MonoTouch implements IDisposable
using (var image = UIImage.FromFile(“foo.png”)){
surface.DrawImage(image, 20, 20);
}
What about App Size?20 MB (compressed) limit on 3G/Edge
downloads.Net BCL and other libraries are hugeMono Linker to the rescue!
OutletsInstance VariablesPointer to an object.Exposed to classes.Can be strong or loosely typed
MD will strong type
ActionsObjects emit broadcast messages to
receiversYou can do this C#MonoDevelop takes care of the details for
youCreates partial methods for you extend
MonoTouch EventsSupports Objective-C pattern:webView.Delegate = new MyWebViewDelegate();
•C# style events as well:webView.PageLoaded += delegate {
HideSpinningWheel();}
UITableViewTable.TableCell.Binding Data.Example.
DebuggingConsole.WriteLine(“Debugging inside of
MonoTouch”);printf(“I made it to this line!\n”)Breakpoints.
DebuggerMonoTouch debugger leverages Mono’s
new Soft-DebuggerSupports the SimulatorSupports the Device...
even over WiFi
Debugging CaveatsDebug binaries on devices are very largeCannot debug Main or FinishedLaunching
on deviceConsumes more memory runtimePerformance hit
Urban Spoon applicationAcceleration.Example.
Getting started Get iPhone SDK from AppleGet Mono from NovellGet MonoTouch (evaluation version
is free)Get MonoDevelopRegister with Apple iPhone
Developer Program and purchase MonoTouch for putting apps on device and AppStore.
One more thing...
iPadBut you want to develop for the iPad...24 Hours after the SDK was released...MonoTouch support for iPad.
How do I find out more?Ebook now.Book available shortly.http://monotouch.info.http://forums.monotouch.net.
Scalable Development, Inc.
• Development.• Training.• Mentoring.• Expert Development Help.
– Database.– User Interface.– AJAX.