Objective-C, CocoaTouch oh my! MonoTouch is an innovative platform that allows the C# developer to write applications for the iPhone and iPad using a subset of Mono, the open source implementation of the .Net Framework. In this talk, we will look at MonoTouch, what you need to work on MonoTouch and explore a simple application created using MonoTouch. If you are curious about MonoTouch, curious about how to get started with MonoTouch or simply curious about how .Net plays with Apple technologies, this is the lap for you.
12. Note:The opinions expressed today are my own and do not represent my employer’s views in any way. Nothing discussed should be considered official or sanctioned by my employer or any other organization I’m affiliated with. Joey Filichia has been writing code since 1982, turning a hobby into a career in 1997. Over the course of his career, Joey has worked as a systems administrator, web developer, architect, database administrator and developer. Although "Innovative and Creative" are sometimes negative when applied to programmers, over time Joey has made those traits work for his career. Currently, he is Lead of Research and Development for Denver Public Schools. His current passion is trying to find new ways to use technology as a tool to help students improve their learning skills. Currently, Joey is developing applications for the iPad, iPhone and Windows Phone 7.
13. What is Mono? Open Source Project that provides a CLR compiler for .NET on non-Windows OS Web Site: http://www.mono-project.com/Main_Page Most of the.NET framework exists in Mono Here’s what doesn’t exist: System.Management does not map to Linux There are no plans to implement WPF Windows Workflow is a future enhancement Entity Framework isn’t available Server-SideOData is not available, because it depends on the Entity Framework CodeContracts have been implemented in an API, but only partial tooling exists.
14. What is MonoTouch? Funded and managed by Novell Allows .Net Developers to create native applications using C# that can compile and run on iOS devices (iPhone, iPod, iPad) In essence, it compiles .Net code into Objective-C compatible code.
15. How does it do it without violating the Apple Licensing Agreement? But it still won’t run Adobe Flash… April 2010 : “Third Party Tools are prohibited” Tech Republic’s Justin James said “…I believe that signing this agreement is about equal to selling your soul for a grilled cheese sandwich.” September 2010 : “Third Party Tools are not prohibited”
16. How much of MonoTouch matches .NET Framework? Most of the .NET 2.0 Core LINQ Generics WCF ADO.NET wrappers for SQLite Silverlight 2.0 API Wraps iOS APIs
17. What doesn’t exist? JIT-less environment is restricted by the kernel Eliminates CodeDom DRL Reflection Memory Management P/Invoke methods
18. Just-In-Time versus Ahead-Of-Time Apple DOES NOT allow Just-In-time Compiling (JIT) .NET uses Just-In-Time Compiling (JIT) MonoTouch uses Ahead-of-Time Compiling (AOT) Ahead of Time Compiling is also known as Static Compilation AOT Compiling creates all the native code that JIT would normally generate Links to runtime to create a single ARM processor capable native binary IL code is stripped from the managed assemblies, leaving just metadata
19. Garbage Collection Managed Code handles garbage collections Objective-C for iOS uses Retain Counts Retain Counts : Reference Counts : Memory Pointers != Dealloc Pointers MonoTouch handles garbage collection Creates an “AutoRelease” pool for anything that exists on the main thread and any child threads
20. What do I need to do to get started with MonoTouch? Intel Based Genuine Macintosh “… MonoTouch is not supported when running on non-genuine Apple hardware (Hackintsoshes) or other OS X installations virtualized in violation of Apple's license agreement, as we're unable to perform any kind of quality assurance testing for these systems, or otherwise diagnose issues that might occur in these scenarios.” – www.monotouch.net Latest iOS SDK Currently at 4.02 (as of March 2011) Apple Developer’s Account ($99 a Year) Familiarity with Apple’s Development Restrictions
21. Installing MonoTouch Installation order is VERY IMPORTANT! Remember, RTFI!!!! http://monotouch.net/Documentation/Installation at least OSX version 10.5.7 Leopard (OSX 10.6.6 Snow Leopard needed for iOS 4) Install iOS SDK Install Mono Framework (MonoDevelop is installed by default when Mono is installed) Install MonoTouch iPhone Configuration Utility from Apple Developer Certificates for testing on devices (simulator comes default)
22. Now is the time we Demo and Code! Getting Started You can’t escape the xibs! Drop controls on the Interface Builder Wire up the outlets in the AppDelegate Access them from the C# Code Behind… Must use delegates, models and views…it’s the Objective C way. Virtual Machines…Visual Studio (2008010) via a VM (Virtual Box is free…) means you can use Visual Studio to handle coding using a familiar environment. Just make sure to map a reference path within the project to the directory that holds the Mono dll’s
23. References and Resources Mono Project Main Page : http://mono-project.com/Main_Page Mono Develop : http://monodevelop.com/ MonoTouch : http://monotouch.net/ MonoTouch Pricing and Trials : http://monotouch.net/Store Reference Book “Professional iPhone Programming with MonoTouch and .NET/C#:” : http://www.softpro.com/0-470-63782-x.html MonoTouch Tutorials : http://monotouch.net/Tutorials
24. References and Resources Inside Apple's insane developer agreement http://www.techrepublic.com/blog/programming-and-development/inside-apples-insane-developer-agreement/2486 New iPhone Developer Agreement Bans the Use of Adobe’s Flash-to-iPhone Compiler http://daringfireball.net/2010/04/iphone_agreement_bans_flash_compiler