Lesson 1 Flashcards

Create Project Sunshine

1
Q

Project Structure (cmd ;), ->app -> flavors

A

versions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

AVD

A

Android Virtual Device

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

stack

A

application layer, application framework, c/c++ libs & Android Runtime, Linux Kernel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ADB

A

Android Debug Bridge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ADB commands

A

push, pull, shell, logcat…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

gradle task

A

atomic work for build

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

./gradlew tasks

A

run on command line to list runnable gradle tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

adb list commands

A

enter adb into terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Apps are…

A

collections of connected components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

4 types of app components

A

Activity, Service, Content Provider, Broadcast Receiver (BACS) | (Br, A,S,Cp)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Android Manifest does what with components?

A

Register components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Activity

A

Component responsible for user interaction (view); a “single focused thing the user can do”.
Responsible for creating the window the application uses to draw and receive events from the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Experience of App, Activities

A

Experience app as a sequence of activities, beginning with launcher. Kept as a stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Android Manifest’s launcher

A

launch tag for application. Registered to an activity, with an intent filter for launching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what layout does for activity

A

layout contains information about what to display, and how to display it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

res folder

A

application resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

resources

A

strings, images, files, layouts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

layout file

A

xml format, contains view objects

19
Q

onCreate in java activity, layout

A

setContentView to some layout; “inflates layout… Android reads your XML file and generates Java objects for each of the tags in your layout file”; i.e. instantiates layout

20
Q

views

A

created by activity to show information, and be interacted with. Rectangular area responsible for drawing and handling events.

21
Q

xml layout file; for activity, stored where

A

how an activity determines what views to create + where to put them. Stored in res folder “layouts”

22
Q

UI components

A

view type that’s often interacted with. E.g. TextView, EditText, ImageView, Button, Chronometer

23
Q

Layout/Container_View

A

typically contain group of views, determine position. E.g. LinearLayout, RelativeLayout, FrameLayout, ScrollView, ConstraintLayout

24
Q

wrap_content

A

shrink view to wrap whatever is inside the view

25
Q

match_parent

A

expand view to parent’s size

26
Q

app/build.gradle

A

contains dependencies; eg. dependency for constraint layout: “com.android.support.constraint:constraint-layout:1.0.0-beta4”. In Gradle scripts.

27
Q

where to instantiate TextView?

A

inside activity’s java, after inflating a layout with that TextView

28
Q

how to connect inflated TextView with activity code?

A
  1. use id
  2. declare TextView as property of class,
  3. inflate layout with TextView
    in OnCreate: setContentView(R.layout.activity_main);
  4. in onCreate, set TextView to id:
    “findViewById(R.id.tv_toy_names)”
29
Q

layout id syntax

A

e.g.: “@+id/tv_toy_names”

@ : “treat stuff inside quotes as not a string literal, but look for contents inside Android Resources.
+ : create id if doesn’t already exist
id : creating an id, not reference (style, string, image)

creates an id inside Resources, where above becomes R.id.tv_toy_names

30
Q

steps to add TextView

A
  1. add ID to TextView in layout
  2. Find ID for TextView in MainActivity.javasource
  3. Append the contents to TextView
31
Q

Array syntax Java

A

String[]

32
Q

for-each loop Java syntax

A
for (   : ) {
// do thing with item
}
33
Q

xml syntax

A

TODO (?)

34
Q

widgets

A

single-purpose views, such as buttons, edit-text

35
Q

constraint layout - special layout how?

A

uses constraints to allow for dynamic layouts; different window sizes

36
Q

Why LinearLayout, GridLayout, ConstraintLayout?

A

No absolute layout; dynamic size. Follow principles of “responsive design”

37
Q

FrameLayout for?

A

only one child view; like a listview that fills content area. Put in corners

38
Q

LinearLayout for?

A

Stack views vertically or horizontally

39
Q

ConstraintLayout for?

A

Complex, powerful. Figure out each view’s position specifically.

40
Q

XML Framelayout

A
41
Q

constraint layout dependency

A

remove/add “implementation ‘com.android.support.constraint:constraint-layout:1.1.3’” in build.gradle.dependencies

42
Q

Java Array init with values

A

{“str1”, “str2”, “str3”};

43
Q

Getting inflated layout views in OnCreate

A
Class {
    property;
    OnCreate(){
        property ()
    }
}
44
Q

setContentView?

A

in onCreate, setContentView to xml file