mono for android... for google devs

25
Google Developer Group January 14th, 2013

Upload: craig-dunn

Post on 31-Aug-2014

13.060 views

Category:

Technology


2 download

DESCRIPTION

Presentation to the East Bay Google Developers Group - January 14th, 2013

TRANSCRIPT

Page 1: Mono for Android... for Google Devs

Google Developer GroupJanuary 14th, 2013

Page 2: Mono for Android... for Google Devs

Craig DunnDeveloper Evangelist

[email protected] @conceptdev

Xamarin's 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 between MonoDevelop and Visual Studio. What's in it for Java developers? C# is an easy leap, and you can then re-use your code on iOS and Windows devices. We'll look at the tooling, building an Android app with C# and the principles of sharing code with iPhones, iPads and Windows.

Mono for Android... for Google Developers

Page 3: Mono for Android... for Google Devs

Your  own  sub  headlineHeadline

OVERVIEW

Page 4: Mono for Android... for Google Devs

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/

Page 5: Mono for Android... for Google Devs

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

Page 6: Mono for Android... for Google Devs

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

Page 7: Mono for Android... for Google Devs

What is Mono for Android?

• LINQ support

• .NET XML APIs

• Event handling & delegates

• Parallel LINQ

Page 8: Mono for Android... for Google Devs

• Point and Click UI generation• Code completion to explore Android APIs• Source control (Subversion & Git)• Use Visual Studio or our own cross-platform IDE

Rich IDE Support

Page 9: Mono for Android... for Google Devs

• Debug with Android simulator and on devices• Set breakpoints, watches, single-step through code, hover over variables• Change object values real-time

Debugging on Emulator & Devices

Page 10: Mono for Android... for Google Devs

Your  own  sub  headlineHeadline

DEMO

Page 11: Mono for Android... for Google Devs

• /res/ & R.java• findViewById• Android.xml• Anonymous classes• Naming (InitialCaps)!

Who moved my cheese?

Page 12: Mono for Android... for Google Devs

Your  own  sub  headlineHeadline

Tech stuff

Page 13: Mono for Android... for Google Devs

• 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...

Runtime

Page 14: Mono for Android... for Google Devs

Mono 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)]

Linking

Page 15: Mono for Android... for Google Devs

• 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

Binding

Page 16: Mono for Android... for Google Devs

xamarin.com/mobile• Camera• Contacts• Geolocation• Compass/Accelerometer • Notifications

For Android, iOS, Win Phone & Win 8/RT

Xamarin.Mobile APIs

Page 17: Mono for Android... for Google Devs

• Share code• Shared data with SQLite• Shared web services with WebClient/

HttpClient• Conditional compilation (if required)

Write your UI for each platform

Cross-Platform Development

Page 18: Mono for Android... for Google Devs

iCircuit• Code re-use

Cross-Platform Development

http://praeclarum.org/

Page 19: Mono for Android... for Google Devs

Your  own  sub  headlineHeadline

DEMO

Page 20: Mono for Android... for Google Devs

MWC 2012 sample

Cross-Platform Development

Page 21: Mono for Android... for Google Devs

mwc.xamarin.com

Cross-Platform Development

Page 22: Mono for Android... for Google Devs

Cross-Platform Development

Other Cross-Platform Libraries

• MonoCross code.google.com/p/monocrossCross-platform UI framework

• Vernacular github.com/rdio/vernacularCross-platform localization framework

• MonoGame monogame.netCross-platform XNA game framework, from Xbox to Windows RT (as well as iOS and Android)

Page 23: Mono for Android... for Google Devs

Complete access to iOS & Android UI and APIsNative binary, not interpreted, for responsive, fluid performance

under the most demanding app scenarios

Customers

Infinite Flight TouchDrawiOS, Mac & Android

(Samsung only)

RdioiOS, Android, WP

Page 24: Mono for Android... for Google Devs

Your  own  sub  headlineHeadline

Questions?

Page 25: Mono for Android... for Google Devs

Your  own  sub  headlineHeadline

Thank you!

Learn more at our conferencexamarin.com/evolve

Austin, Texas ~ April 14-17