Mono for Android...for Google Developers Craig Dunn Developer Evangelist firstname.lastname@example.org @conceptdevXamarins Mono for Android tools let you build applications for Android using C#.You can write code on a Mac with MonoDevelop, or for Windows choose betweenMonoDevelop and Visual Studio. Whats in it for Java developers? C# is an easyleap, and you can then re-use your code on iOS and Windows devices. Well look atthe tooling, building an Android app with C# and the principles of sharing code withiPhones, iPads and Windows.
What is Mono?Open source implementation of the .NET Common Language Runtime (CLR) and the C# language • Linux, MacOS X, Solaris, BSD, Wii, PS3, PS Vita! • Started in 2001 as Ximian, purchased by Novell in 2003, released in 2004 • 2009: MonoTouch created (released 2010) • 2010: Mono for Android created (released 2011) • 2011: Novell purchased by Attachmate ($2.2b) - Xamarin is born... http://www.mono-project.com/ http://github.com/mono http://xamarin.com/
What is Mono for Android? Mono C# & .NET + Android API bindings + UI designer + Visual Studio plug-in (or MonoDevelop) = Android application development http://xamarin.com/android Released April 2011
What is Mono for Android?• Runs natively - Fast enough for games, eg. flight simulation• Use platform’s UI controls• Access all Android features• Incorporate existing Java
What is Mono for Android? • LINQ support • .NET XML APIs • Event handling & delegates • Parallel LINQ
Rich IDE Support • Point and Click UI generation • Code completion to explore Android APIs • Source control (Subversion & Git) • Use Visual Studio or our own cross-platform IDE
Debugging on Emulator & Devices• Debug with Android simulator and on devices• Set breakpoints, watches, single-step through code, hover over variables• Change object values real-time
Runtime• Mono runtime is bundled with each app• For faster debugging, a Shared Runtime can be installed• Apps deployed to users always include the runtime, but...
LinkingMono compiler strips out unused classes/libraries • Mobile devices – size matters! • Trap for young players: it might strip out stuff you want to keep! • Classes/methods/properties used via Reflection • Classes/methods/properties used in serialization operationsBy default disabled in DEBUG, so stuff will work there and mysteriously break in RELEASE [Preserve(AllMembers = true)]
Binding• Xamarin releases new versions of Mono for Android that correspond to each API level and release from Google.• Tools are provided to help you ‘bind’ any existing Java lib (.jar) to incorporate into your Mono app
Cross-Platform DevelopmentOther Cross-Platform Libraries• MonoCross code.google.com/p/monocross Cross-platform UI framework• Vernacular github.com/rdio/vernacular Cross-platform localization framework• MonoGame monogame.net Cross-platform XNA game framework, from Xbox to Windows RT (as well as iOS and Android)
Customers Complete access to iOS & Android UI and APIs Native binary, not interpreted, for responsive, fluid performance under the most demanding app scenarios Infinite Flight TouchDraw Rdio iOS, Mac & Android iOS, Android, WP (Samsung only)