Wednesday, 6 April 2011

Mono for Android 1.0 & MonoTouch 4.0 released

Today Novell released Mono for Android 1.0 and MonoTouch 4.0 (blog posts from Miguel de Icaza detailing the releases can be found here for Mono for Android and here for MonoTouch).
I’ve used MonoTouch quite a lot, hence the rather detailed tutorial I released, which was detailed here.
I’ve also been spending quite some time getting up to speed with Mono for Android. Indeed in February, I gave a talk on building apps with Mono for Android (or MonoDroid as it was referred to back then) in conjunction with Delphi Prism at a conference in Las Vegas. Also, today I spoke at a User Group meeting about building an Android app in C# using Mono for Android.
Over the next few weeks I’ll be working on a tutorial that shows the use of Mono for Android with C# and will post when it becomes available.
In addition, I’ve kept notes of various interesting things, such as issues, gotchas, solutions to problems I’ve encountered and so on. As I write up the tutorial I’ll be posting some of those tidbits as and when they crop up in the coverage.
One thing I learned today from Miguel’s release blog post, though, is that when you build an app for distribution the Mono linker is engaged. This generates a single binary containing only the items known to be used (and their dependencies) – everything else is stripped out. Smart linking in other words.
This is in contrast to how things work during development where you link against a shared runtime that is deployed to your emulator or device. The idea during development is that the executable generated will be smaller, thanks to linking against a shared runtime (well, two shared runtimes actually – there’s the main Mono runtime and a much smaller runtime specific to the version of Android you are targeting). With a smaller executable it takes less time to build and deploy to the emulator or device.
With a single executable generated for distribution this simplifies the question of how these separate entities are to be managed.

Update: This is an old post, and it should be noted that the current versions (at the time of writing this update in Jan 2012) are Mono for Android 4.0 and MonoTouch 5.0.