Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Study Jam 2016

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

cmota

April 30, 2016
Tweet

More Decks by cmota

Other Decks in Education

Transcript

  1. Events - Study Jam - Developer/ Inside Stories - Software

    Craftsmanship - Google DevFest - Google Summit - GDG Kids - … make your suggestion!
  2. Android   adj. Possessing human features. n. A mobile robot

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

    Interactive #3 - Work with the Android Framework and Control Flow
  4. 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
  5. 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
  6. 15

  7. 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
  8. 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
  9. 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
  10. 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
  11. 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 ???
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. action bar list view custom list view row tab widget

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

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

    • image button • image view window full screen Demystify action bar
  20. - Select the views - Position the views - Style

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

    - + PRICE $10 ORDER TextView Button android:id android:margin android:textAllCaps android:onClick
  22. - 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
  23. 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
  24. - 2 Million apps on Google Play - (User) Default

    applications - Do not reinvent the wheel Lesson  3:  Work  with  the  Android  Framework  and  Control  Flow
  25. 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
  26. 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$
  27. 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
  28. 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
  29. - 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
  30. 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);   }
  31. - Educational app that teaches 5 new things - Any

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

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

    Christophe KindJI Traffic Signs SA by Rulani Nevhufumba Brain Training Game by Kostya Bakay