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

Android StudyJam session 3

Android StudyJam session 3

Deck from the Android StudyJam event where we walked through the Udacity course on Android Fundamentals

0b0edcef2f3aee7b51cda719e5f82d7c?s=128

Arpit Mathur

February 23, 2016
Tweet

Transcript

  1. JAVA AND OOP ANDROIDPHILLY STUDY JAM 3

  2. TEXT BASIC PROGRAMMING ▸ Given some inputs you want some

    outputs ▸ I have a city name, give me the weather ▸ I have a message, I want it to appear on Twitter
  3. TEXT SO BASIC PROGRAMMING…

  4. TEXT WEATHER APP

  5. TEXT BASIC JAVA ▸ Variables (with data types ): int

    count = 5 ▸ Collections : Array, ArrayList, etc: ▸ int[] numbers = new Int [] { 1, 2, 3 } ▸ Conditionals: ▸ if / else, switch, etc ▸ Functions / Methods ▸ private int getMaxValue(int valueA, int valueB) { … } ▸ Classes ▸ Packages
  6. TEXT BASIC ANDROID ▸ Layout Files ▸ Resources ▸ Java

    Files ▸ …gradle
  7. TEXT DEFINING VS CALLING A METHOD ▸ Method inputs (arguments)

    ▸ Output from a method (the Cake example) ▸ Using Return values ▸ Exercise: Implement Submit order (return a string representing the summary text) ▸ Exercise: Modifying the code to read: “Price Summary” and then the text
  8. TEXT ANDROID RESOURCES ▸ XML Layouts, Text, Images, Icons, Measurements,

    Audio files, etc ▸ AAPT compiles resources to an R file ▸ Code ▸ R.drawable.zzz ▸ R.string.zzz ▸ R.id.zzz ▸ XML: ▸ @drawable / zzz ▸ @string/zzz ▸ @id/zzz (or if you are creating it @+id/zzz)
  9. TEXT XML + JAVA

  10. TEXT JAVA OBJECTS

  11. TEXT

  12. TEXT

  13. TEXT

  14. TEXT CREATING JAVA OBJECTS

  15. TEXT

  16. TEXT ▸ Inheritance ▸ Using the findViewById() method ▸ Casting

    ▸ Set data on views
  17. TEXT ▸ Java if/else ▸ Prevent -ve values for coffee

    examples ▸ Intents ▸ Styles
  18. BONUS ROUND IF I WAS TO ASK YOU… ▸ Take

    a number. If the number is below 10, print “thats low”, otherwise print “thats high”
  19. TEXT