Save 37% off PRO during our Black Friday Sale! »

Android Study Jam 2016

D8a3623b157508fecdae1f8e756f362f?s=47 cmota
April 30, 2016

Android Study Jam 2016

Slides from our local Study Jam dedicated to Android. It follows Udacity: Android Development for Beginners - How to Make an Android App

Lesson 1: Building layouts
Lesson 2: Making an App Interactive
Lesson 3: Work with the Android Framework and Control Flow

Available at: https://www.udacity.com/course/android-development-for-beginners--ud837

D8a3623b157508fecdae1f8e756f362f?s=128

cmota

April 30, 2016
Tweet

Transcript

  1. Android Study Jam apoio de:

  2. +GDGCoimbra @GDGCoimbra gdgcoimbra@gmail.com fb.me/GDGCoimbra gdgcoimbra.github.io gdgcoimbra.slack.com

  3. None
  4. Events - Study Jam - Developer/ Inside Stories - Software

    Craftsmanship - Google DevFest - Google Summit - GDG Kids - … make your suggestion!
  5. None
  6. None
  7. Study  Jam  Worldwide in GDG Yangon

  8. Android   adj. Possessing human features. n. A mobile robot

    or automaton, especially one that resembles a human.
  9. Schedule #1 - Building layouts #2 - Making an App

    Interactive #3 - Work with the Android Framework and Control Flow
  10. Lollipop 11/2014 Marshmallow 10/2015 KitKat
 09/2013 Jelly Bean
 08/2012 Ice

    Cream
 sandwich
 10/2011 Honeycomb
 02/2011 Gingerbread 12/2010 Froyo
 05/20103 Eclair
 10/2009 Donut
 09/2009 Cupcake
 04/2009 Beta
 02/2009 Alpha
 09/2008
  11. None
  12. Google  Play TV

  13. Google  Play Instagram 1 000 000 000 4.5 LinkedIn 100

    000 000 4.2 Hangouts 5 000 000 000 3.9 Strava 10 000 000 4.6
  14. Looking for Android SDK location…

  15. 15

  16. None
  17. Android is starting… Starting course

  18. Lesson  1:  Building  layouts - TextView - ImageView - Button

  19. Demystify ImageView TextView defined on XML

  20. Lesson  1:  XML  Syntax <TextView          android:text=“Happy

     Birthday!”          android:background=“@android:color/darker_gray”          android:layout_width=“150dp”          android:layout_height=“75dp”  />
 attribute name attribute value view element
  21. Lesson  1:  XML  Syntax <TextView          android:text=“Happy

     Birthday!”          android:background=“@android:color/darker_gray”          android:layout_width=“150dp”          android:layout_height=“75dp”            android:textSize=“19sp”/>
 density-independent pixels
  22. Lesson  1:  Building  layouts HTC Wildfire S medium resolution device

    Samsung Galaxy S2 high resolution device LG Nexus 4 extra-high resolution device mdpi hdpi xhdpi
  23. Lesson  1:  Building  layouts HTC Wildfire S medium resolution device

    Samsung Galaxy S2 high resolution device LG Nexus 5 extra-high resolution device mdpi hdpi xhdpi
  24. Lesson  1:  2x2  Pixels HTC Wildfire S medium resolution device

    Samsung Galaxy S2 high resolution device LG Nexus 5 extra-high resolution device mdpi hdpi xhdpi ???
  25. Lesson  1:  2x2  dp HTC Wildfire S medium resolution device

    Samsung Galaxy S2 high resolution device LG Nexus 5 extra-high resolution device mdpi hdpi xhdpi same physical size
  26. Lesson  1:  XML  Syntax <TextView          android:text=“Happy

     Birthday!”          android:background=“@android:color/darker_gray”          android:layout_width=“150dp”          android:layout_height=“75dp”            android:textSize=“19sp”/>
 scale-independent pixels adjusts based on user preferences
  27. Lesson  1:  Building  layouts <ImageView          android:src=“@drawable/cake”

             android:layout_width=“wrap_content”          android:layout_height=“wrap_content”          android:scaleType=“center”/>
 attribute name attribute value view element
  28. Lesson  1:  android:scaleType center fitCenter fitXY centerCrop

  29. Lesson  1:  Building  layouts 1 2 3 1 2 3

    1 2 3 1 2 3 Horizontal Linear Layout Vertical Linear Layout Vertical LL Equal Height Vertical LL LeftOver Height
  30. Lesson  1:  View  Groups <LinearLayout          android:layout_width=“wrap_content”

             android:layout_height=“wrap_content”          android:orientation=“vertical”  >
        <TextView                  android:layout_width=“wrap_content”                  android:layout_height=“wrap_content”                  android:text=“Happy  Birthday!”  />          <TextView                  android:layout_width=“wrap_content”                  android:layout_height=“wrap_content”                  android:text=“You’re  the  best!”  />   </LinearLayout> container closing tag
  31. None
  32. action bar list view custom list view row tab widget

    • image view • text view • linear layout • relative layout • … Demystify
  33. grid view custom view tab widget custom view • image

    view • text view • linear layout • relative layout • image button • … Demystify action bar
  34. horizontal scroll view image view custom view • linear layout

    • image button • image view window full screen Demystify action bar
  35. None
  36. real time preview project structure view content

  37. - Select the views - Position the views - Style

    the views Exercise  #1  -­‐  Create  a  Birthday  Card  app Happy Birthday Happy Birthday, Sérgio! From, GDGCoimbra!
  38. Lesson  2:  Making  an  App  Interactive Just Java QUANTITY 2

    - + PRICE $10 ORDER TextView Button android:id android:margin android:textAllCaps android:onClick
  39. - Select the views - Position the views - Style

    the views Exercise  2:  Create  a  Coffee  Order  app Just Java QUANTITY 2 - + PRICE Total: $10 Thank you! ORDER Just Java QUANTITY 2 - + PRICE $10 ORDER
  40. Lesson  3:  Work  with  the  Android  Framework  and  Control  Flow

    Resource Type in Java code in XML Image R.drawable.photo @drawable/photo String R.string.hello @string/hello Layout XML file R.layout.activity_main @layout/activity_main ID R.id.text_view @id/text_view Color R.color.red @color/red hello olá bonjour <TextView…/> app_name #FF0000 #00FF00 #0000FF
  41. - 2 Million apps on Google Play - (User) Default

    applications - Do not reinvent the wheel Lesson  3:  Work  with  the  Android  Framework  and  Control  Flow
  42. Lesson  3:  Work  with  the  Android  Framework  and  Control  Flow

    Just Java QUANTITY 2 - + PRICE $10 TOPPINGS Whipped cream ORDER SUMMARY No whipped cream Name: GDGCoimbra Quantity: 2 Total: 10$ ScrollView Change to landscape
  43. Exercise  3:  Add  new  functionalities Just Java QUANTITY 2 -

    + PRICE $10 TOPPINGS Whipped cream ORDER SUMMARY No whipped cream Name: GDGCoimbra Quantity: 2 Total: 10$
  44. Exercise  3 Just Java QUANTITY 2 - + PRICE $10

    ORDER TOPPINGS Whipped cream ORDER SUMMARY No whipped cream Name: GDGCoimbra Quantity: 2 Total: 10$ Name Chocolate No chocolate
  45. Exercise  3:  Interact  with  other  apps Just Java QUANTITY 2

    - + PRICE $10 ORDER TOPPINGS Whipped cream ORDER SUMMARY No whipped cream Name: GDGCoimbra Quantity: 2 Total: 10$ Name Chocolate No chocolate intent action data
  46. - Allows other app to perform an action - No

    need to (re)implement functionalities - No need to know each app will be triggered Lesson  3:  Work  with  the  Android  Framework  and  Control  Flow
  47. Lesson  3:  Work  with  the  Android  Framework  and  Control  Flow

    Intent  intent  =  new  Intent(Intent.ACTION_SENDTO);   intent.setData(Uri.parse(“mailto:”));   intent.putExtra(Intent.EXTRA_SUBJECT,  “Order  for:  “  +  name);   intent.putExtra(Intent.EXTRA_TEXT,  message);   if  (intent.resolveActivity(getPackageManager())  !=  null  {      startActivity(intent);   }
  48. - Educational app that teaches 5 new things - Any

    subject - User interaction - Link with other applications Project From, GDGCoimbra! Android is starting… Starting application
  49. Project - Two weeks for completion - Continuous feedback -

    Best practices - You can reach us on G+/ Slack/ etc.
  50. Project  Worldwide From, GDGCoimbra! Apprendre les bases du roller by

    Christophe KindJI Traffic Signs SA by Rulani Nevhufumba Brain Training Game by Kostya Bakay
  51. - developer.android.com/develop/index.html - google.com/design/spec/material-design/introduction.html - vogella.com/tutorials/Android/article.html - android-arsenal.com/demo - java2s.com/Code/Android/CatalogAndroid.htm

    Materials
  52. gdgcoimbra.github.io GDGCoimbra@gmail.com /GDGCoimbra +GDGCoimbra @GDGCoimbra gdgcoimbra.slack.com @cafonsomota @nunoar @bffcorreia @sdsantos