Slide 1

Slide 1 text

JAVA AND OOP ANDROIDPHILLY STUDY JAM 3

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

TEXT SO BASIC PROGRAMMING…

Slide 4

Slide 4 text

TEXT WEATHER APP

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

TEXT BASIC ANDROID ▸ Layout Files ▸ Resources ▸ Java Files ▸ …gradle

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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)

Slide 9

Slide 9 text

TEXT XML + JAVA

Slide 10

Slide 10 text

TEXT JAVA OBJECTS

Slide 11

Slide 11 text

TEXT

Slide 12

Slide 12 text

TEXT

Slide 13

Slide 13 text

TEXT

Slide 14

Slide 14 text

TEXT CREATING JAVA OBJECTS

Slide 15

Slide 15 text

TEXT

Slide 16

Slide 16 text

TEXT ▸ Inheritance ▸ Using the findViewById() method ▸ Casting ▸ Set data on views

Slide 17

Slide 17 text

TEXT ▸ Java if/else ▸ Prevent -ve values for coffee examples ▸ Intents ▸ Styles

Slide 18

Slide 18 text

BONUS ROUND IF I WAS TO ASK YOU… ▸ Take a number. If the number is below 10, print “thats low”, otherwise print “thats high”

Slide 19

Slide 19 text

TEXT