Reklama 

Reklama 
for code/slides/like...
TFS - adress
https://www.facebook.com/andrzejrpiotrowski
siranen@gmail.com
O Mnie
• Nazywam się Andrzej Piotrowski aka Sir Anen 
• Jestem po Rolnictwie – Kadży orze jak Może 
• Pracowałem dla Cre...
Agenda
• Xamarin – Z czym sie to wiąże w Mobile
• Android – Jak wygląda praca z Nim
• Android Design Patterns – Budujemy z...
XAMARIN?

“The best damn mobile team,
building the best damn mobile platform.”
MY TEŻ TAK MOŻEMY 
Mono?
•

•

“The Mono runtime contains a code execution engine that
translates ECMA CIL byte codes into native code and
su...
Jak działa Mono?
Pamiętajmy o
certyfikacji :
Apple ma duże
restrykcje

Pamiętajmy o
certyfikacji :
Google ma duże
możliwoś...
Struktura - Core
Piszemy tylko kod (core code) RAZ, możemy skupić na
dopasowawniu do UI danego systemu operacyjnego.
xamarin.mobile
Komponent dla wykorzystania do loklaizacji, zdjec czy
dostepu do kontaktow dla wszystkich platform.
xamarin.Social
Komponent dla wykorzystania do App.Net, Twitter,
Facebook, and Flickr
xamarin.auth
Komponent dla wykorzystania do OAuth.
Data
RestSharp, SQLite.NET, and JSON.net to nie które
rzeczy które programista wykorzystuje w pracy.
Komponenty Androida czyli
jak żyć na Google Play
Omówienie zasad projektowania od zera javy do .net
codera. Android to jak...
Architecture of Android
Applications

Application Framework

Libraries

Android Runtime

Linux Kernel

Android Runtime
Lib...
Android SDK
Android Application Life Cycle
onCreate()
onStart()

Starting

onRestart()
onStart()
onResume()

Running
onResume()

onSav...
Design Patterns
Operation System (Graphic Design)
Android OS

One version for all devices

Customized System by Manufactur...
Design Patterns
Navigation
Android OS

Application

Hardware/Application

1 System Button

3-4 System Buttons

Folie 19

i...
Navigation - Back Button
Android OS

Software

Hardware
System feature – 4 Buttons

Folie 20

iOS (iPhone)
Display Size/Resolution
iOS (iPhone)
3 Devices

1000+ Devices

2 Display resolutions/sizes

Different screen sizes (3,7’ –...
Android SDK emulator ->
<- Genymotion
emulator
Android Application

What’s inside an App ?
Default
Activity

Libraries

Other
Default
Default
Activities
Activity
Activit...
Anatomia Xamarin Android
app
Android Manifest.xml
Edit App Name & Package, Icon, Version #, Min and
Target Android SDKs, Permissions
specify supported screens

http://developer.android.com/guide/topics/manifest/supp
orts-screens-element.html
Pro tip: need for speed

You can specify hardware acceleration for the app or for
specific activities.
http://developer.an...
More activity options

http://developer.android.com/guide/topics/manifest/acti
vity-element.html
Activities
Activity
Lifecycle
lifecycle in use
another example

OnResume and OnPause are good places
to do assignment and release.
declaring activity behavior

In this case, InitialActivity is our splash/loading screen.
layouts
Anatomy of a layout
includes
layouts for orientations

By creating a directory “layout-land,” Activities will use
this as content when orientation chan...
layouts for screen sizes

“layout-large” is for Android apps below API-13, “layoutswXXXdp” is for 13 and above.
How layouts are connected to
your code
Strings.xml
How to connect strings.xml to
your code

You can link via layout xml or use
“GetString” from your Activity.
string array

This can be used as a data provider for a spinner.
Style.xml
declare reusable styles
Units of measure
px
Pixels - corresponds to actual pixels on the screen.

in
Inches - based on the physical size of the sc...
Connect style to view
Drawables
Using a PNG

PNGS FOR STATES
vector drawable
alternative drawables

Using folder naming conventions will tell
Android what version of the drawable to use
MainApplication
sending intents
receiving intents
Create and assign adapter
Fragments
Android 3.0+
Set layout of Activity
init tab fragments
the fragment
fragment
lifecycle
Fragments are important

Fragments promote code reuse.
custom
views
Month Layout
Week Layout
notated cell
OnDraw
UpdateSwatches
Calendar month activity
Update calendar
Update week labels
when month events set
Updating cell swatches
Podsumowanie
- Android SDK w Xamarinie nie jest specialnie
trudny ale trzeba mieć background z
aplikacjami – dobrze znać ADB.
- Ilość u...
Zadanie Domowe
Workshop - Szkolenie Xamarin Android
Workshop - Szkolenie Xamarin Android
Workshop - Szkolenie Xamarin Android
Workshop - Szkolenie Xamarin Android
Workshop - Szkolenie Xamarin Android
Workshop - Szkolenie Xamarin Android
Workshop - Szkolenie Xamarin Android
Upcoming SlideShare
Loading in …5
×

Workshop - Szkolenie Xamarin Android

686 views

Published on

Szkolenie

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
686
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Wymyśl tytuł
  • Bla bla – o mnie jako produkcie – o każdym jako osobie znającym swoją wartość
  • Przygoda z Mobile 
  • Nuda
  • Konkret
  • Be the one – I am the Champion
  • Poziom Zawansowania – 1-5 C#Poziom Zawansowania – 1-5 MobilePoziom Zawansowania – 1-5 Mono
  • Programoanie to nie tylko czysty kod – to też interface / grafiki / sposoby interakcji.
  • Pokazanie projektu MWC – omówienie co to jest – jak działa i dlaczego korzystamy z gotowca 
  • Wytłumaczyć poszczególne pola
  • Różnica pomiędzy minium android version a target (packagename)
  • Omoiwc android:smallScreensIndicates whether the application supports smaller screen form-factors. A small screen is defined as one with a smaller aspect ratio than the &quot;normal&quot; (traditional HVGA) screen. An application that does not support small screens will not be available for small screen devices from external services (such as Google Play), because there is little the platform can do to make such an application work on a smaller screen. This is &quot;true&quot; by default.android:normalScreensIndicates whether an application supports the &quot;normal&quot; screen form-factors. Traditionally this is an HVGA medium density screen, but WQVGA low density and WVGA high density are also considered to be normal. This attribute is &quot;true&quot; by default.android:largeScreensIndicates whether the application supports larger screen form-factors. A large screen is defined as a screen that is significantly larger than a &quot;normal&quot; handset screen, and thus might require some special care on the application&apos;s part to make good use of it, though it may rely on resizing by the system to fill the screen.android:xlargeScreensIndicates whether the application supports extra large screen form-factors. An xlarge screen is defined as a screen that is significantly larger than a &quot;large&quot; screen, such as a tablet (or something larger) and may require special care on the application&apos;s part to make good use of it, though it may rely on resizing by the system to fill the screen.
  • Beginning in Android 3.0 (API level 11), the Android 2D rendering pipeline supports hardware acceleration, meaning that all drawing operations that are performed on a View&apos;s canvas use the GPU. Because of the increased resources required to enable hardware acceleration, your app will consume more RAM.Hardware acceleration is enabled by default if your Target API level is &gt;=14, but can also be explicitly enabled. If your application uses only standard views and Drawables, turning it on globally should not cause any adverse drawing effects. However, because hardware acceleration is not supported for all of the 2D drawing operations, turning it on might affect some of your custom views or drawing calls. Problems usually manifest themselves as invisible elements, exceptions, or wrongly rendered pixels. To remedy this, Android gives you the option to enable or disable hardware acceleration at multiple levels. See Controlling Hardware Acceleration.
  • Masa możliwości dla danej aktywności – coś jak properties ale inaczej interpertowane
  • Mowa o aktywnościach – co to jest i dlaczego istnieją
  • Bardzo ważne !!!!
  • Jak się z tego korzysta w Xamarin
  • Teraz czas na pytania o coś – powrot do jakiegoś slajdu
  • Workshop - Szkolenie Xamarin Android

    1. 1. Reklama  Reklama 
    2. 2. for code/slides/like... TFS - adress https://www.facebook.com/andrzejrpiotrowski siranen@gmail.com
    3. 3. O Mnie • Nazywam się Andrzej Piotrowski aka Sir Anen  • Jestem po Rolnictwie – Kadży orze jak Może  • Pracowałem dla Credit Swiss, Viessmann R&D czy IBM’ie + Agencje Kreatwyne – Wrocław • Przeprowadze dla was wstęp techniczny • Czemu nikt mi za to nie płaci  • Wiem że Umiem – Ty też to Umiesz (siła woli) • Zaczynamy przygode – pytanie to ręka w górę
    4. 4. Agenda • Xamarin – Z czym sie to wiąże w Mobile • Android – Jak wygląda praca z Nim • Android Design Patterns – Budujemy z głową i dla ludzi a nie dla własnego dobra (community) • Google Play – Jak to wygląda od strony Dev • Xamarin Android Aplikacja - Przygoda • Zadanie domowe - Rozdzielenie • Ustalenie współpracy ze mną
    5. 5. XAMARIN? “The best damn mobile team, building the best damn mobile platform.” MY TEŻ TAK MOŻEMY 
    6. 6. Mono? • • “The Mono runtime contains a code execution engine that translates ECMA CIL byte codes into native code and supports a number of processors: ARM, MIPS SPARC, PowerPC, S390 , x86, x86-64 and IA-64 for 64-bit modes.” • • Windows Mono 1.0 was released on June 30, 2004 Runs on Linux, OSX, Windows, PS3, XBox 360, Wii Phone 7 i 8 + Android + iOS
    7. 7. Jak działa Mono? Pamiętajmy o certyfikacji : Apple ma duże restrykcje Pamiętajmy o certyfikacji : Google ma duże możliwości Pamiętajmy o certyfikacji : Windows ma duże pretensje że wógle coś wrzucasz na Sklep 
    8. 8. Struktura - Core Piszemy tylko kod (core code) RAZ, możemy skupić na dopasowawniu do UI danego systemu operacyjnego.
    9. 9. xamarin.mobile Komponent dla wykorzystania do loklaizacji, zdjec czy dostepu do kontaktow dla wszystkich platform.
    10. 10. xamarin.Social Komponent dla wykorzystania do App.Net, Twitter, Facebook, and Flickr
    11. 11. xamarin.auth Komponent dla wykorzystania do OAuth.
    12. 12. Data RestSharp, SQLite.NET, and JSON.net to nie które rzeczy które programista wykorzystuje w pracy.
    13. 13. Komponenty Androida czyli jak żyć na Google Play Omówienie zasad projektowania od zera javy do .net codera. Android to jakieś 11000 urządzeń do wsparcia. Obecnie jest wersja APK 19 – my piszemy od APK 11.
    14. 14. Architecture of Android Applications Application Framework Libraries Android Runtime Linux Kernel Android Runtime Libraries Linux Kernel • Dalvik Virtual machine Application Framework Applications C/C++ Libraries • Work asfile (Hardware Abstraction Layer) • .dex HAL • API Interface application Built in and User Interface through Java • Device Drivers Efficient • Compact and • Activity manager.apk files Can install using • Limited memory & Power Handling User Interface • memory management • Content ->Phone-> .jar ->WeChat, Web Browser, Providers Example: .class Dialer, .dex • .java 2D/3D Management • ProcessGraphics others Hello Android or • Location Manager etc • Core LibrariesBrowser Engine, SQLite Media Acces, Networking • Java Standard Edition
    15. 15. Android SDK
    16. 16. Android Application Life Cycle onCreate() onStart() Starting onRestart() onStart() onResume() Running onResume() onSaveInstanceState() onPause() Paused Stopped onSaveInstanceState() onStop() onDestroy() Destroyed onDestroy()
    17. 17. Design Patterns Operation System (Graphic Design) Android OS One version for all devices Customized System by Manufacturer Folie 18 iOS (iPhone)
    18. 18. Design Patterns Navigation Android OS Application Hardware/Application 1 System Button 3-4 System Buttons Folie 19 iOS (iPhone)
    19. 19. Navigation - Back Button Android OS Software Hardware System feature – 4 Buttons Folie 20 iOS (iPhone)
    20. 20. Display Size/Resolution iOS (iPhone) 3 Devices 1000+ Devices 2 Display resolutions/sizes Different screen sizes (3,7’ – 10,1’) Different resolutions iPod iPad Folie 21 iPhone Android OS
    21. 21. Android SDK emulator -> <- Genymotion emulator
    22. 22. Android Application What’s inside an App ? Default Activity Libraries Other Default Default Activities Activity Activity Service Content Android Manifest Drawable Layouts Values Assets
    23. 23. Anatomia Xamarin Android app
    24. 24. Android Manifest.xml
    25. 25. Edit App Name & Package, Icon, Version #, Min and Target Android SDKs, Permissions
    26. 26. specify supported screens http://developer.android.com/guide/topics/manifest/supp orts-screens-element.html
    27. 27. Pro tip: need for speed You can specify hardware acceleration for the app or for specific activities. http://developer.android.com/guide/topics/graphics/hard ware-accel.html
    28. 28. More activity options http://developer.android.com/guide/topics/manifest/acti vity-element.html
    29. 29. Activities
    30. 30. Activity Lifecycle
    31. 31. lifecycle in use
    32. 32. another example OnResume and OnPause are good places to do assignment and release.
    33. 33. declaring activity behavior In this case, InitialActivity is our splash/loading screen.
    34. 34. layouts
    35. 35. Anatomy of a layout
    36. 36. includes
    37. 37. layouts for orientations By creating a directory “layout-land,” Activities will use this as content when orientation changes. http://docs.xamarin.com/guides/android/application_fund amentals/handling_rotation/
    38. 38. layouts for screen sizes “layout-large” is for Android apps below API-13, “layoutswXXXdp” is for 13 and above.
    39. 39. How layouts are connected to your code
    40. 40. Strings.xml
    41. 41. How to connect strings.xml to your code You can link via layout xml or use “GetString” from your Activity.
    42. 42. string array This can be used as a data provider for a spinner.
    43. 43. Style.xml
    44. 44. declare reusable styles
    45. 45. Units of measure px Pixels - corresponds to actual pixels on the screen. in Inches - based on the physical size of the screen. mm Millimeters - based on the physical size of the screen. pt Points - 1/72 of an inch based on the physical size of the screen. dp Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen
    46. 46. Connect style to view
    47. 47. Drawables
    48. 48. Using a PNG PNGS FOR STATES
    49. 49. vector drawable
    50. 50. alternative drawables Using folder naming conventions will tell Android what version of the drawable to use
    51. 51. MainApplication
    52. 52. sending intents
    53. 53. receiving intents
    54. 54. Create and assign adapter
    55. 55. Fragments Android 3.0+
    56. 56. Set layout of Activity
    57. 57. init tab fragments
    58. 58. the fragment
    59. 59. fragment lifecycle
    60. 60. Fragments are important Fragments promote code reuse.
    61. 61. custom views
    62. 62. Month Layout
    63. 63. Week Layout
    64. 64. notated cell
    65. 65. OnDraw
    66. 66. UpdateSwatches
    67. 67. Calendar month activity
    68. 68. Update calendar
    69. 69. Update week labels
    70. 70. when month events set
    71. 71. Updating cell swatches
    72. 72. Podsumowanie
    73. 73. - Android SDK w Xamarinie nie jest specialnie trudny ale trzeba mieć background z aplikacjami – dobrze znać ADB. - Ilość urządzeń do przetestowania – o matkoale da się dzięki usługą (TestCloud) czy (TestDroid) - Emulatory są do bani. Testować na urządzeniu bo nakładki. - Planować z głową swoj LayoutUX/Design
    74. 74. Zadanie Domowe

    ×