mono for android... for google devs

Post on 31-Aug-2014

13.060 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

Google Developer GroupJanuary 14th, 2013

Craig DunnDeveloper Evangelist

craig@xamarin.com @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

Your  own  sub  headlineHeadline

OVERVIEW

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

• 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

• 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

Your  own  sub  headlineHeadline

DEMO

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

Who moved my cheese?

Your  own  sub  headlineHeadline

Tech stuff

• 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

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

• 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

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

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

Xamarin.Mobile APIs

• 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

iCircuit• Code re-use

Cross-Platform Development

http://praeclarum.org/

Your  own  sub  headlineHeadline

DEMO

MWC 2012 sample

Cross-Platform Development

mwc.xamarin.com

Cross-Platform Development

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)

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

Your  own  sub  headlineHeadline

Questions?

Your  own  sub  headlineHeadline

Thank you!

Learn more at our conferencexamarin.com/evolve

Austin, Texas ~ April 14-17

top related