17
http://conceptdev.blogspot.c @conceptdev Fast ANDroid Furious Android with C# in 20 minutes

OzAltNet Fast-ANDroid-furious

Embed Size (px)

Citation preview

Page 1: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Fast ANDroid Furious

Android with C# in 20 minutes

Page 2: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

What is Mono? Open source implementation of the CLR

Linux, MacOS X, Solaris, BSD, Wii, PS3 Started in 2001 as Ximian, purchased by Novell

in 2003, released in 2004 2009: MonoTouch created (released 2010) 2010: MonoDroid created (released 2011) 2011: Novell purchased by Attachmate ($2.2b)

entire Mono team sacked > startup Xamarin created...

http://www.mono-project.com/ http://github.com/mono

Page 3: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

What is was Mono for Android? Mono ('Silverlight subset')

+ Android API bindings

+ 'AXML' intelli-sense support

+ Visual Studio plug-in (or MonoDevelop)

= Android application

http://mono-android.net/

Released April 2011Retired May 2011??

Page 4: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Mono for Android System Req's To play in the simulator (FREE)

Mac OSX with MonoDevelop OR Windows (VisualStudio 2010 or MonoDevelop)

Oracle's Java SDK Google's Android SDK Mono for Android Trial (and MonoDevelop IDE)

To get onto a device Mono for Android Prof or Enterprise license (USD399+)

To get onto Android Market Google Developer account (USD25)

Page 5: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

//TODO: Activity

OnCreate SetContentView and FindViewById<T>

/layout/ , /res/ and Resources AndroidManifest.xml Application

OnCreate Intent

PutExtra() and GetStringExtra

Page 6: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Page 7: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Activity Lifecycle Active/running Paused Stopped Killed/shutdown

You should always call up to your superclass when implementing these methods

Page 8: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Details! Debugging Linking UI

iOS Android

Navigation Databinding F.A.Q.

Page 9: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Debugging 'soft debugger' gets embedded in your app

Can be configured (IP address, port) Binaries are much larger (of course)

Allows breakpoints, step-through, call stack Works via TCP/IP, so you can debug the

Simulator AND the device (untethered, so long as wifi is enabled).

Page 10: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Linking 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 operations

By default it's disabled in DEBUG, so stuff will work there and mysteriously break in RELEASE

[Preserve(AllMembers = true)]

Page 11: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Navigation

Getting from screen to screen

StartActivity() Intent

SetClasstypeof(AnActivity)

PutExtraCan also 'trigger' other

applications

PushViewController() UIViewController

Subclass and pass instance

… also UITabBar items

Page 12: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Databinding (lists)

More work that you are used to...

BaseAdapter GetView Count GetItem(.ItemClick is attached to the

ListView itself)

UITableViewSource GetCell RowsInSection RowSelected

Page 13: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

'translation'

Page 14: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Example: RestGuide

Runs on Android, iOS and

Windows Phone 7

github.com/conceptdev

Page 15: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Example: MIX11

Runs on Android, iOS and

Windows Phone 7

mix11.confapp.com

Page 16: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Any questions?

Page 17: OzAltNet Fast-ANDroid-furious

http://conceptdev.blogspot.com

@conceptdev

Professional iPhone w/ MonoTouch