230 likes | 332 Views
Introduction to Android Development Using .NET and Mono. Greg Shackles Senior Software Engineer OLO Online Ordering greg@gregshackles.com. Who is this guy?. Greg Shackles greg@gregshackles.com gregshackles.com Twitter: @ gshackles Google+: plus.tl/ gshackles github.com/ gshackles.
E N D
Introduction to Android Development Using .NET and Mono Greg Shackles Senior Software Engineer OLO Online Ordering greg@gregshackles.com
Who is this guy? Greg Shackles greg@gregshackles.com gregshackles.com Twitter: @gshackles Google+: plus.tl/gshackles github.com/gshackles
C# To Go http://shackl.es/CSharpToGo
What We’ll Cover What is Android? Android architecture Mono for Android Android components Demos Cats!
What is Android? Full stack Open source SDK provides tools and Java API Applications typically written in Java Purchased by Google in 2005 v1.0 released in October 2008 developer.android.com
What is Mono For Android? Mono runtime (LINQ, reflection, GC, etc) Linker Wraps Java/Android API Visual Studio 2010 or MonoDevelop android.xamarin.com
Mono for Android Architecture • Android/Managed Callable Wrappers • JNI bridges to talk between Android and Mono
Mono for Android API .NET events replace listener interfaces Action replaces Runnable Enumerations Properties Attributes and tooling generate configuration OpenTK Uses standard Android resource files
Reusability Story UI Silverlight MonoTouch Mono for Android C# Business Logic Runtime .NET Mono Platform WP7 iOS Android
Activities • Single task • UI • Hierarchy of views • Typically defined in XML • Activity stack • 3 Basic States • Running • Paused • Stopped
Broadcast Receivers No UI Receive / react to announcements Apps can broadcast custom messages Example: phone call, low battery
Services No UI Stays running when app loses focus Can be accessed by other apps Example: music player
Content Providers Enable applications to share data
Intents • Messages used to activate components • Launch an activity • Start or bind to a service • Broadcast a message • Implicit intents • Intent filters • Components register capabilities • Example: launcher
Storage Shared preferences Internal storage External storage (SD card) Database (SQLite)
Java C#