• Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,278
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
17
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Catevachestii de baza, ceeste mono, ceeste android siapoibineintelesceeste mono for android. Arhitecturasiapi-ul. Vom face cateva demo-urisiapoi ne vomintoarcesademitizamcatevamituri, savorbimdespreavantajesidezavantaje.
  • Termenulcheiecandvorbim de android totusieste un.La bazaplatformeistalinuxul. Vomvedeamai in detaliuingredientelecandvomdiscutadesprearhitectura
  • In mod normal, candzic o apknativa android, ma gandesc la unascrisa in java.
  • Vomvedeaastazi ca se poatesi in alt limbaj
  • Sa ne concentarmputinasupraelementelorcheie ale stack-ului: bazaestelinux, middleware-ulilreprezinta runtime-ulsicatevalibrarii (c,c++) siapoi vine application framework-ul care = java + aplicatiile de sus care pot fifolosite de noi in creeareaaltoraplicatii
  • Trecemrepede in revistacomponentelecheie ale uneiaplicatii androidLa bazaoricareiaplicatiistauactivitatile. Practicestevorba de un ecran.
  • Apoivinserviciile care ne permit safacemoperatii in background fara ca aplicatianoastrasa fie pornita (de ex: playerul de muzica, downloadulunuifisier)
  • Urmeaza content providerii care formeaza un mechanism ordonat de a permite sharing-ul de date intreaplicatii
  • si broadcast receiverii care sunt de faptnisteascultatori la anumitesemnale ale sistemului. De exemplu: low batery alert. Intrebaripanaacum? Mentionez ca saavem de a face cu o app nativa android, trebuiesaavem minim unadintreacestecomponente.
  • Gata cu android-ul. Ceestemonodroid?
  • Sau o platforma care nepermitesaconsturimaplicatii android native scriind in .net
  • Langamasinavirtualadalvik, staacumsimasinavirtuala mono. Deci ne putemputemscrie in .netfarasa ne temem. Te potifolosi de elegantalimbajuluisi de aproape tot ceeaceitiofera el (aici ma refer la faptul ca potifolosi LINQ, functii lambda, xml parser siaproapetoatecelelalte cu care eraidejaobisnuit in .net) - bine, nu a fostsicazulmeu, dar pot sazic ca am invatatceva.net cu ocaziaasta.
  • Avand in vedere ca dezvoltamaplicatiipentrumobil, dimensiuneaaplicatieiconteaza. Linkerulestecel care se ovcupa de “stergerea” acelorparti din frameworkul mono, sau din api-urile native care nu suntfolosite de aplicatiata. Astfel, size-ul care ajungedupaprocesul de linking petelefoneste cu celputin 70% maiputindecat era initial.
  • Face binding complet API-ul Android si JAVA. Astainseamna ca exista un layer de wrappere care itipermitepracticsa. acceseziaccesaapi-urile respectiveCa sirecapitulare: mono for android estecompus din 3 maricomponente: compilatorul, masinavirtuala, librariile.Intrebari?
  • de wrappereestecumvaintrecodul.netsicodul java, aflati ca Monoruleaza side by side cu masinavirtualaDalvik. Astainseamna ca Mono nu comunica cu kernelul din linux via dalvik. Este situat fix in aceimaginatilasi loc cu dalviksicomunica direct cu kernelul din linux. Bineinteles ca pentruaccesareaapi-urilor android / java native mono vacomunica cu dalvik via acel layer de binding.
  • Action = un tip de delegat in c# care defineste o actiune. O actiuneeste o metoda care primeste un singurparamentrusi nu returneazanimic. General vorbind, delegat = tip cereferentiaza o metoda. (ca si cum arfi un pointer la o functie)Runnable = interfatacestabileste o metodacomuncaprin care o clasafurnizeaza cod threadului care dorestesail execute.Interfata are o singurametoda: run();Enumeratiile: grupare de constantePropierati: geterisiseteri in c#Atributele – adnotarile din java. Foate utile, pentru ca genereazaconfigurarisiastfeltepoatescuti de o mare bataie de cap.OpenTK – librarileopenGL care itipermitesafacichestiigraficefoartedragute. Are suportsi in monoTouch, deci se poaterefolosi cod. 
  • Action = un tip de delegat in c# care defineste o actiune. O actiuneeste o metoda care primeste un singurparamentrusi nu returneazanimic. General vorbind, delegat = tip cereferentiaza o metoda. (ca si cum arfi un pointer la o functie)Runnable = interfatacestabileste o metodacomuncaprin care o clasafurnizeaza cod threadului care dorestesail execute.Interfata are o singurametoda: run();Enumeratiile: grupare de constantePropierati: geterisiseteri in c#Atributele – adnotarile din java. Foate utile, pentru ca genereazaconfigurarisiastfeltepoatescuti de o mare bataie de cap.OpenTK – librarileopenGL care itipermitesafacichestiigraficefoartedragute. Are suportsi in monoTouch, deci se poaterefolosi cod. 
  • Action = un tip de delegat in c# care defineste o actiune. O actiuneeste o metoda care primeste un singurparamentrusi nu returneazanimic. General vorbind, delegat = tip cereferentiaza o metoda. (ca si cum arfi un pointer la o functie)Runnable = interfatacestabileste o metodacomuncaprin care o clasafurnizeaza cod threadului care dorestesail execute.Interfata are o singurametoda: run();Enumeratiile: grupare de constantePropierati: geterisiseteri in c#Atributele – adnotarile din java. Foate utile, pentru ca genereazaconfigurarisiastfeltepoatescuti de o mare bataie de cap.OpenTK – librarileopenGL care itipermitesafacichestiigraficefoartedragute. Are suportsi in monoTouch, deci se poaterefolosi cod. 
  • Appde,mo care tine mintecate click-uriaidatpe un buton
  • PRODUCTIVITATE. Nu doar la cei care deja le stiu, darsipentruceinoi (ca si mine). Dupace le-au invatat, le cam place sa le folosieasaca
  • Un ramp up destul de dificilpentrucei care nu stiudeloc.net. Dureazaputinpanaceteobisnuiestisainveti cam ceclasetrebuiesafolosesti etc.
  • DroidDraw can be used, but the quality and the result it is not guarantied

Transcript

  • 1. Mono for Android DevelopmentMonday Presentation by Codrin Dițu
  • 2. Basics Overview Architecture API Demos Myths Benefits Topics• Basics• Overview• Architecture• API• Demos• Myths• Benefits• Conclusions CODRIN DIȚU
  • 3. Basics Overview Architecture API Demos Myths Benefits What is Mono? Mono? CODRIN DIȚU
  • 4. Basics Overview Architecture API Demos Myths Benefits Mono• is an open source implementation of .NET Framework based on the ECMA standards CODRIN DIȚU
  • 5. Basics Overview Architecture API Demos Myths Benefits Mono• is an open source implementation of .NET Framework based on the ECMA standards• aims to be the leading choice for development of Linux applications CODRIN DIȚU
  • 6. Basics Overview Architecture API Demos Myths Benefits Mono• is an open source implementation of .NET Framework based on the ECMA standards• aims to be the leading choice for development of Linux applications• allows developers to easily create cross platform applications CODRIN DIȚU
  • 7. Basics Overview Architecture API Demos Myths Benefits What is Android? Android? CODRIN DIȚU
  • 8. Basics Overview Architecture API Demos Myths Benefits What is Android?• world’s most popular mobile platform (48,6 US market share, January 2012) CODRIN DIȚU
  • 9. Basics Overview Architecture API Demos Myths Benefits What is Android?• 1st release in October 2008, 5th this fall  CODRIN DIȚU
  • 10. Basics Overview Architecture API Demos Myths Benefits What is Android? CODRIN DIȚU
  • 11. Basics Overview Architecture API Demos Myths Benefits What is Android?• full software stack, based on Linux 2.6 CODRIN DIȚU
  • 12. Basics Overview Architecture API Demos Myths Benefits What is Android?• apps typically are written in Java (SDK provides tools and Java API) CODRIN DIȚU
  • 13. Basics Overview Architecture API Demos Myths Benefits What is Android?• apps typically are written in Java (SDK provides tools and Java API) CODRIN DIȚU
  • 14. Basics Overview Architecture API Demos Myths Benefits Android architecture CODRIN DIȚU
  • 15. Basics Overview Architecture API Demos Myths Benefits Android key components• Activities single screen with an UI CODRIN DIȚU
  • 16. Basics Overview Architecture API Demos Myths Benefits Android key components• Activities single screen with an UI• Services background running long operations CODRIN DIȚU
  • 17. Basics Overview Architecture API Demos Myths Benefits Android key components• Activities single screen with an UI• Services background running long operations• Content Providers organized mechanism for data sharing CODRIN DIȚU
  • 18. Basics Overview Architecture API Demos Myths Benefits Android key components• Activities single screen with an UI• Services background running long operations• Content Providers organized mechanism for data sharing• Broadcast receivers respond to system-wide announcements CODRIN DIȚU
  • 19. Basics Overview Architecture API Demos Myths Benefits What is Monodroid? Monodroid? CODRIN DIȚU
  • 20. Basics Overview Architecture API Demos Myths Benefits Mono for Android CODRIN DIȚU
  • 21. Basics Overview Architecture API Demos Myths Benefits Mono for AndroidCommercialProductdevelop nativeAndroid appsusing .NET CODRIN DIȚU
  • 22. Mono Basics Overview Architecture API Demos Myths Benefits Runtime use .NET standards LINQ, GC, lamba s etc Mono for AndroidCommercialProductdevelop nativeAndroid appsusing .NET CODRIN DIȚU
  • 23. MonoLinker Basics Overview Architecture API Demos Runtime Myths Benefitsreduces appsize by static use .NETanalysis of your standardsapplication LINQ, GC, lamba s etc Mono for AndroidCommercialProductdevelop nativeAndroid appsusing .NET CODRIN DIȚU
  • 24. MonoLinker Basics Overview Architecture API Demos Runtime Myths Benefitsreduces appsize by static use .NETanalysis of your standardsapplication LINQ, GC, lamba s etc Mono for AndroidCommercialProduct Completedevelop native binding forAndroid apps Java /using .NET Android API CODRIN DIȚU
  • 25. Basics Overview Architecture API Demos Myths Benefits Monodroid Architecture• Android/Managed Callable Wrappers (JNI bridges to do the talking) CODRIN DIȚU
  • 26. Basics Overview Architecture API Demos Myths Benefits Monodroid API• .NET events replace listener interfaces CODRIN DIȚU
  • 27. Basics Overview Architecture API Demos Myths Benefits Monodroid API• .NET events replace listener interfaces CODRIN DIȚU
  • 28. Basics Overview Architecture API Demos Myths Benefits Monodroid API• Action replaces Runnablepublic delegate void Action<in T>( T obj )Example:Search(string query, Action<IEnumerable<Tweet>> callback) CODRIN DIȚU
  • 29. Basics Overview Architecture API Demos Myths Benefits Monodroid API• Action replaces Runnable CODRIN DIȚU
  • 30. Basics Overview Architecture API Demos Myths Benefits Monodroid API• Enumerations• Properties• Attributes and tooling generate configuration• OpenTK• Uses standard Android resources CODRIN DIȚU
  • 31. Basics Overview Architecture API Demos Myths Benefits Code• MonoDevelop or Visual Studio 2010• tutorials on android.xamarin.com•DEMOs CODRIN DIȚU
  • 32. C# Code (Mono for android) HelloWord native Android Application
  • 33. Java Code (the standard way) HelloWord native Android Application
  • 34. Basics Overview Architecture API Demos Myths Benefits Why bother with Mono after all?• Mith #1: the build apps are not native Uses the exact same libraries as native apps CODRIN DIȚU
  • 35. Basics Overview Architecture API Demos Myths Benefits Why bother with Mono after all?• Mith #1: the build apps are not native• Mith #2: it is for the lazy ones You have to learn the native framework CODRIN DIȚU
  • 36. Basics Overview Architecture API Demos Myths Benefits Why bother with Mono after all?• Mith #1: the build apps are not native• Mith #2: it is for the lazy ones• Mith #3: the build apps are slowerC# on Mono VMJava on Dalvik VM CODRIN DIȚU
  • 37. Basics Overview Architecture API Demos Myths Benefits Why bother with Mono after all?• Mith #1: the build apps are not native• Mith #2: it is for the lazy ones• Mith #3: the build apps are slower• Mith #4: it is a hard approach Java and C# are … similar, plus you have support from support from Xamarin (and google, stackoverflow, etc.) CODRIN DIȚU
  • 38. Basics Overview Architecture API Demos Myths Benefits Why bother with Mono after all?• Mith #1: the build apps are not native• Mith #2: it is for the lazy ones• Mith #3: the build apps are slower• Mith #4: it is a hard approach• Mith #5: no reason CODRIN DIȚU
  • 39. Basics Overview Architecture API Demos Myths Benefits Benefits• Benefit#1: cross platform (except GUI code) CODRIN DIȚU
  • 40. Basics Overview Architecture API Demos Myths Benefits Benefits CODRIN DIȚU
  • 41. Basics Overview Architecture API Demos Myths Benefits Benefits• Benefit#2: less code  less bugs CODRIN DIȚU
  • 42. Basics Overview Architecture API Demos Myths Benefits Benefits• Benefit#3: C# o LINQ + org.xml.sax.XmlReader o Lamdas CODRIN DIȚU
  • 43. Basics Overview Architecture API Demos Myths Benefits Drawbacks• Works Slow in Debugging CODRIN DIȚU
  • 44. Basics Overview Architecture API Demos Myths Benefits Drawbacks• Android UI designer does not exist CODRIN DIȚU
  • 45. Basics Overview Architecture API Demos Myths Benefits Drawbacks• It is a commercial product, so it costs! CODRIN DIȚU
  • 46. Basics Overview Architecture API Demos Myths Benefits Conclusions• Monodroid is a good approach when developing from scratch a cross-platform native mobile app CODRIN DIȚU
  • 47. Basics Overview Architecture API Demos Myths Benefits References• http://tnw.co/usmobilemarketshare2012• http://xamarin.com/monoforandroid• http://www.infoq.com/presentations/Android -Development-Using-NET-and-Mono• http://www.slideshare.net/conceptdev/cross platform-mobile-dev-with-mono• http://www.slideshare.net/klmcmahon/mono- for-android CODRIN DIȚU
  • 48. Basics Overview Architecture API Demos Myths Benefits Thank you! Question! Questions? CODRIN DIȚU
  • 49. Basics Overview Architecture API Demos Myths Benefits CODRIN DIȚU