README.org 4.5 KB
Newer Older
Christopher League's avatar
Christopher League committed
1
2
3
* Apps19

Code and instructions for the 2019 LIU Apps Summer Honors Institute
4
5

[[file:etc/lesson-graph.png]]
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

* Activity object, onClick methods

** Learning objectives
- Know the major areas of the IDE: Project tree, Editor, Layout design
  tab, Build output, Log output.
- Be able to create and run Android Virtual Devices (AVD)
- Understand how to add instance variables and simple methods in Java.
- Create live Buttons and TextViews on an Android Activity.

** Tasks
- Start with branch ~lesson1~, which displays a counter and an
  Increment button.
- Add a decrement button.
- Add a reset (to zero) button.
- Try disabling the decrement and reset button when the counter is
  already zero.
- Try adding a Random button, which sets counter to some number from
  zero to one thousand.

* Arrays & loops

** Learning objectives
- Syntax for one- and two-dimensional array creation and indexing in
  Java.
- Syntax of (counter-based) for loops in Java.
- Understand how (nested) for loops and (two-dimensional) arrays work
  together.
- Understand how to translate two-dimensional grid coordinates into a
  one-dimensional index (and vice-versa).

** Tasks
- Scaffolds for this unit are in ~lesson2~ branch.
- Construct methods for initializing, printing, finding min/max within
  arrays.
- Use a for loop to initialize a series of TextViews with Strings from
  an array.
- Work on a console version of the Flood puzzle!

* Binary, hex, & colors

Christopher League's avatar
Christopher League committed
47
48
49
50
51
52
53
54
55
** Learning objectives
- Convert between binary and decimal, and between binary and
  hexadecimal.
- Understand additive color model where red-green-blue can be combined
  to convey other hues.

** Tasks
- Demonstrations for this unit are in ~lesson3~ branch.

56
57
* Layouts & XML

Christopher League's avatar
Christopher League committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
** Learning objectives
- Construct basic layouts using horizontal and vertical LinearLayout.
- Understand the parameters and options for width, height, weight,
  padding, gravity.
- Edit in both Design mode and Text (XML) mode

** Tasks
- Starting from ~lesson4~ branch, build a layout like my FloodGame
  options screen, featuring title, play button, two SeekBars
  (sliders), and some RadioButtons. (The palettes don't need to show
  multiple colors; we'll cover that later in "Custom views.")

[[file:etc/floodgame-options.png]]

72
73
* Life cycle & saveInstanceState

Christopher League's avatar
Christopher League committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
** Learning objectives
- Understand the [[https://developer.android.com/guide/components/activities/activity-lifecycle][Android Activity Lifecycle]], and some reasons that an
  app screen might be suspended or destroyed.
- Know how to enable and navigate Android developer options on a
  device.
- Know how to switch between apps on Android, and kill a running app.

** Tasks
- Start with ~lesson5~ branch (which is essentially a solution to
  ~lesson1~).
- On your emulator, enable developer options and set "Apps » Don't
  keep activities"
- Override ~saveInstanceState~ in the counter app so that we can
  maintain the counter between interruptions.
- Illustrate that input widgets maintain their state automatically, as
  long as ~super.saveInstanceState~ is invoked.

91
92
* Custom views & onDraw

Christopher League's avatar
Christopher League committed
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
** Learning objectives
- Understand how to use ~Paint~ objects to draw on a canvas, including
  fill and stroke styles in different colors.
- Understand the canvas coordinate system, with origin on the upper
  left.
- Know how to use a few basic canvas drawing methods, like ~drawRect~
  and ~drawCircle~.

** Tasks
- Start with ~lesson6~ branch. The layout includes an object of class
  ~MyCustomView~.
- The custom view contains a boolean instance variable is controlled
  by a checkbox.
- Come up with a simple drawing to put in the box, using basic shapes
  like rectangles and circles. It should have at least three shapes
  and two colors.
- Make /some/ aspect of the drawing optional, so the check box will
  affect the drawing in some way.

112
113
* Intents & startActivity

Christopher League's avatar
Christopher League committed
114
115
116
117
118
119
120
121
122
123
124
125
126
127
** Learning objectives
- Understand how to invoke a new activity with ~startActivity~ in a
  typical way (so the back button works).
- Be able to pass data from the previous activity to the new one,
  using the ~Intent~ object.

** Tasks
- Start with the scaffolded app in ~lesson7~ branch. It's the counter,
  but this time there is a checkbox and a "Verify" button. The idea is
  that the user is supposed to predict whether the displayed number is
  prime, and then click Verify to see its factors.
- We will need to create the Intent in onClickVerify in MainActivity,
- And then initialize the values in onCreate in FactorActivity.

128
* A working FloodGame!
Christopher League's avatar
Christopher League committed
129
130
131

- Check out ~lesson8~ and try the items marked TODO in the
  MainActivity class.