Welcome!

Mobile IoT Authors: Zakia Bouachraoui, Pat Romanski, Yeshim Deniz, Carmen Gonzalez, Liz McMillan

Related Topics: Mobile IoT, Microsoft Cloud, Silverlight, Wearables

Mobile IoT: Blog Feed Post

Would You Like to Touch My Mono?

There are a thousand reasons for people to use monotouch, including the ability to re-use .NET

Those of you who have been reading my blog for a while know that I'm not always just about .NET - I'm a pretty huge iPhone guy as well. In fact, I'm a fan of all technologies and programming languages that don't suck, regardless of who makes them or on what platform they run.

At one point I was actually thinking about writing a book for .NET developers to learn Cocoa but other plans, time constraints, and life issues all got in the way. I have posted countless times comparing the worlds of Cocoa and .NET and have twice presented at Apple's WWDC comparing both the desktop and mobile programming environments of Apple and Microsoft.

So you can imagine the raw, unfiltered, pure geek joy that coursed through my veins when I heard about Monotouch, a programming library coupled with an IDE (MonoDevelop + Interface Builder) that would let me write my iPhone applications using C# and the .NET Framework (the mono version).

To get Monotouch working you're going to need the following:

  • A Mac.
    • Intel
    • Running Leopard or Snow Leopard
    • Decently fast (a current Macbook Air is about the slowest I can tolerate for compilations)
  • Monotouch Framework (can download the eval free)
  • MonoDevelop - IDE for mono and monotouch, for the Mac, NOT Windows or linux!
  • $500 for the professional edition, $3500 for the enterprise edition. You can evaluate for free, but you can't put a monotouch app on an actual piece of hardware without forking over the duckets.

Understanding all of the plumbing of how this works requires a time investment that I just can't put forth right now. So, for now, assume that little magic elves within the MonoDevelop IDE perform post-build tasks on your compiled mono application that can then convert it to native iPhone code. When you're working with C# classes like UITableViewController, all you're really doing is telling the post-compile steps that your final C type in the native app will be a UITableViewController. It's smoke and mirrors, but it's damned powerful smoke and mirrors.

So what's it like to build a monotouch application? It's actually pretty similar to building a regular Cocoa Touch application. You create a new project in monotouch (there are several really good "hello world" tutorials available on monotouch from their site). Drag UI elements into your XIB using Interface Builder and, here's where some of the magic starts, create outlets and actions and link your C# code to your interface builder UI elements. I am pretty sure portions of my brain liquified when I first created a C# view controller and ctrl-dragged to link UI actions to the controller.

This is where many of my avid .NET readers are going to think I've simply flipped and gone off the reservation...

Despite the fact that I can now quickly and easily create C#/.NET classes and use them to power my iPhone applications, which gives me access to things like WCF and the absolutely, definitively better XML libraries of .NET... I am not going to be using monotouch for real application development.

ok, I'll pause here to let you all stop shouting, "OMFGWTFTRAITOR!!!1"

A little history: I learned C# in 2000 on .NET 1.0. I published my first book on the .NET Framework in 2001 and have been writing blogs, books, articles, and flaming truckloads of code on this framework for the past 9 years now. If there ever was a human being on the planet who should by all rights reach out to and lovingly hug the Monotouch box - it should be me. However, all of that time and experience has made me wary of layers of abstraction. I learned how to write Cocoa for the Mac when Leopard was in beta. I found the learning curve steep, and painful. I felt like I was being deprogrammed - but it was a good thing. If you remember my blog posts from that era, you'll recall that I felt like I was growing as a programmer and architect. My skills in .NET increased dramatically as a result of the enlightenment that I found while learning Cocoa and Objective-C. My .NET skills also increased (though not as dramatically) when I suffered through writing enterprise Java applications.

I literally spent hours trying to write down the list of reasons why I didn't want to use Monotouch and some of them were extremely valid reasons concerning the fact that monotouch is always going to be behind the leading SDK revision from Apple and blah blah yadda yadda... The bottom line is I just love the way it feels to write Objective-C and Cocoa code. Period.

Bottom line:

[self heart:Cocoa];

That said, there are a thousand reasons for people to use monotouch, including the ability to re-use .NET (mono) code across the client (iPhone) and server as well as to allow .NET developers who have absolutely no experience with Cocoa or Objective-C to quickly and easily get rolling building iPhone apps. In the real world we don't always have the luxury of learning new languages and environments - if you're a .NET developer and your boss tells you write an iPhone app for your company and to do it in 3 weeks or you're fired - you're going to use Monotouch (and so would I). I have the luxury of knowing both .NET and Cocoa and so I can pick and choose. Knowing both, I'll be writing my iPhone apps in Cocoa and the back-end servers that support them in .NET.

More Stories By Kevin Hoffman

Kevin Hoffman, editor-in-chief of SYS-CON's iPhone Developer's Journal, has been programming since he was 10 and has written everything from DOS shareware to n-tier, enterprise web applications in VB, C++, Delphi, and C. Hoffman is coauthor of Professional .NET Framework (Wrox Press) and co-author with Robert Foster of Microsoft SharePoint 2007 Development Unleashed. He authors The .NET Addict's Blog at .NET Developer's Journal.

IoT & Smart Cities Stories
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
To Really Work for Enterprises, MultiCloud Adoption Requires Far Better and Inclusive Cloud Monitoring and Cost Management … But How? Overwhelmingly, even as enterprises have adopted cloud computing and are expanding to multi-cloud computing, IT leaders remain concerned about how to monitor, manage and control costs across hybrid and multi-cloud deployments. It’s clear that traditional IT monitoring and management approaches, designed after all for on-premises data centers, are falling short in ...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...