1 / 28

Introduction to Android Development Using .NET and MonoDroid

Introduction to Android Development Using .NET and MonoDroid. Greg Shackles Senior Application Developer MagazineRadar greg@gregshackles.com. We thank the following companies for their gracious sponsorship. Platinum Sponsor. Gold Sponsors. Silver Sponsors. About Me. Greg Shackles

tass
Download Presentation

Introduction to Android Development Using .NET and MonoDroid

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Android Development Using .NET and MonoDroid Greg Shackles Senior Application Developer MagazineRadar greg@gregshackles.com

  2. We thank the following companies for their gracious sponsorship Platinum Sponsor Gold Sponsors Silver Sponsors

  3. About Me • Greg Shackles • greg@gregshackles.com • gregshackles.com • Twitter: @gshackles • github.com/gshackles

  4. What We’ll Cover • What is Android? • Android architecture • Application lifecycle • Mono / MonoDroid • MonoDroid API • Demos

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

  6. Market Share (US) 28.7% 13%

  7. Architecture

  8. Architecture

  9. Architecture

  10. Architecture

  11. Architecture

  12. Component Types

  13. Activities • Provides UI for one screen • Can start other activities • Hierarchy of views • Typically defined in XML

  14. Activity Lifecycle Activity Starts onRestart() onStart() onResume() onCreate() User navigates back to the activity Activity is running User navigates back to the activity User navigates back to the activity Another activity is loaded Process killed Other apps need memory onPause() This activity is no longer visible onStop() Activity is shut down onDestroy()

  15. Activity Lifecycle (Simplified) • Activity stack • Configuration changes cause activity restart • Activity has 3 basic states • Running • Paused • Stopped

  16. Broadcast Receivers • No UI • Can start an activity • Receive/react to announcements • Apps can broadcast custom messages • Examples: low battery, phone call

  17. Services • No UI, runs in background • Stays running when application loses focus • Can be accessed by many applications • Example: Music player

  18. Content Providers • Enables applications to share data

  19. Intents • Messages used to activate components • Launch an activity • Start or bind to a service • Broadcast a message to receivers • Implicit intents • Intent filters • Components register their capabilities • Example: launcher

  20. Storage • Shared preferences • Internal storage • External storage (SD card) • Database (SQLite) • Remote

  21. Want to write Android applications in .NET? With MonoDroid, you can!

  22. What is Mono? • Implementation of the .NET CLR • Open source • Cross platform • Supports most of .NET 4.0 • Missing WPF, Entity Framework, WF, some WCF

  23. What is MonoDroid? • Runs side by side with Dalvik • Wraps Java/Android API bindings • Commercial product • Currently in public beta • Visual Studio 2010 or MonoDevelop • www.monodroid.net

  24. MonoDroidArchitecture • Android/Managed Callable Wrappers • JNI bridges to talk between Android and Mono • Optional shared runtime

  25. MonoDroid API • .NET events replace listener interfaces • Action replaces Runnable • Enumerations • Properties • Attributes and tooling generate configuration • OpenTK • Uses standard Android resource files

  26. Java vs C# Java

  27. Java vs C# Java C#

  28. Questions?

More Related