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. 3.
  2. 4.

    Events - Study Jam - Developer/ Inside Stories - Software

    Craftsmanship - Google DevFest - Google Summit - GDG Kids - … make your suggestion!
  3. 5.
  4. 6.
  5. 8.

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

    or automaton, especially one that resembles a human.
  6. 9.

    Schedule #1 - Building layouts #2 - Making an App

    Interactive #3 - Work with the Android Framework and Control Flow
  7. 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
  8. 11.
  9. 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
  10. 15.

    15

  11. 16.
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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 ???
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 31.
  23. 32.

    action bar list view custom list view row tab widget

    • image view • text view • linear layout • relative layout • … Demystify
  24. 33.

    grid view custom view tab widget custom view • image

    view • text view • linear layout • relative layout • image button • … Demystify action bar
  25. 34.

    horizontal scroll view image view custom view • linear layout

    • image button • image view window full screen Demystify action bar
  26. 35.
  27. 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!
  28. 38.

    Lesson  2:  Making  an  App  Interactive Just Java QUANTITY 2

    - + PRICE $10 ORDER TextView Button android:id android:margin android:textAllCaps android:onClick
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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$
  34. 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
  35. 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
  36. 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
  37. 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);   }
  38. 48.

    - Educational app that teaches 5 new things - Any

    subject - User interaction - Link with other applications Project From, GDGCoimbra! Android is starting… Starting application
  39. 49.

    Project - Two weeks for completion - Continuous feedback -

    Best practices - You can reach us on G+/ Slack/ etc.
  40. 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