Mono for android

907 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
907
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mono for android

  1. 1. Mono for Android Developing Androidapplications using C# and .NET Willem Meints @wmeints
  2. 2. Agenda Introduction Android Framework App model Java vs. Mono Bindings Runtime Developing Android applications using C# and .NET
  3. 3. Android Open Source Mobile OS from Google Hardware made by many – HTC – Samsung Developing Android applications using C# and .NET
  4. 4. Android Many manufacturers means – Many user interfaces – Many hardware configurations – Many active OS versions Developing Android applications using C# and .NET
  5. 5. Android - Tools Developing Android applications using C# and .NET
  6. 6. Introducing Mono for Android Mono for Android is – .NET Runtime for Android – Bindings to Android API’s – Visual Studio 2010 plugin • MonoDevelop also possible Uses all the Android SDK tools under the hood (emulator, adb, etc.) Developing Android applications using C# and .NET
  7. 7. Cross Platform Mobile Development - Android
  8. 8. Android - Framework Applications Application Framework Libraries & Runtime Linux Kernel Developing Android applications using C# and .NET
  9. 9. Android - Framework Applications Linux Kernel Drivers for Application Framework – Display – Camera Libraries & Runtime – WiFi – Audio – Keypad Linux Kernel – Etc. Developing Android applications using C# and .NET
  10. 10. Android - Framework Applications Dalvik VM Libraries for Application Framework – Media – SQLite Libraries & Runtime – SSL – OpenGL – WebKit Linux Kernel – Etc. Developing Android applications using C# and .NET
  11. 11. Android - Framework Applications Activity Manager Window Manager Application Framework Content Providers Package Manager Libraries & Runtime Location Manager Notification Manager Linux Kernel Telephony Manager Developing Android applications using C# and .NET
  12. 12. Android - Framework Applications Home Contacts Application Framework Phone Browser Libraries & Runtime <your app here> Etc. Linux Kernel Developing Android applications using C# and .NET
  13. 13. App model - Components Applications consist of several components – Activities – Content Providers – Broadcast Receivers – Services Developing Android applications using C# and .NET
  14. 14. App model - Activity lifecycle Activity Initialize Launched layout here onCreate() Restore User navigates to onStart() onRestart() the activity state here onResume() App process comes into the Another activity foreground killed Activity User returns to The activity is no longer visiblerunning the activity Apps with higher state The activitySave is finishing or being onPause() priority need memory here destroyed by the system User navigates to onStop() the activity onDestroy() Activity shut down
  15. 15. App model - Intents Intent View View Intent Broadcast Activity Intent Activity Intent Receiver Intent Intent Content Provider Service Developing Android applications using C# and .NET
  16. 16. App model - Intents Intents are messages routed through the OS Intents are powerful. They allow: – Components of one application to be used by another – Allows applications to replace core OS functionality Developing Android applications using C# and .NET
  17. 17. App model The app model for Mono for Android is the same as for regular Android apps. The behind the scenes however… Cross Platform Mobile Development - Android
  18. 18. Mono for Android architecture Android Android. .NET APIs MCW Java.* Bindings * Mono (.NET Runtime) ACW Dalvik (Java Runtime) Linux Kernel Developing Android applications using C# and .NET
  19. 19. Java vs. Mono - Callable Wrappers Mono Callable Wrappers (MCW) – Mono  Java – Uses JNI ( Java Native Interface ) Android Callable Wrappers (ACW) – Java  Mono – Uses Mono runtime components Developing Android applications using C# and .NET
  20. 20. Cross Platform Mobile Development - Android
  21. 21. Mono for Android - Bindings 99,9% of the Android API is bound to .NET – There’s always a few minor details that work different or couldn’t be converted (yet!) Most of the Java API is bound as well. – These are redundant, but necessary to make some of the Android stuff work. Developing Android applications using C# and .NET
  22. 22. Mono for Android - Runtime Android apps are optimized using the linker – Users don’t need to install the runtime on their phone. It is included in the package. Please note: – While running in debug, the app is not linked unless you specify that it must be linked – Linking in debug has effect on the debugging capabilities Developing Android applications using C# and .NET
  23. 23. Mono for Android - Runtime Need a library that isn’t bound yet? – You can generate them yourself from JAR files. – Project type provided.
  24. 24. Some interesting thoughts Mono for Android is C# for the Android platform, which means – You can reuse a lot of code in Windows Phone and Monotouch apps – If you split your code correctly of course. Developing Android applications using C# and .NET
  25. 25. Some interesting thoughts UI UI UI Business Logic Device abstraction layer Device Device Device Developing Android applications using C# and .NET
  26. 26. Cross Platform Mobile Development - Android
  27. 27. Questions? Cross Platform Mobile Development - Android

×