Android Flashcards

1
Q

What is an Activity?

A

An activity is a single, focused thing that the user can do. Almost all activities interact with the user.

https://developer.android.com/reference/android/app/Activity

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

What is a View?

A
View
- Basic building block of UI
- Drawing and event handling
- Many specialized classes available
Example Views: Button, CheckBox, Spinner, Switch (slider), Plain Text, Multiline Text
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a ViewGroup?

A

A ViewGroup is a special View that holds other views

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

What is a Layout?

A
Layout
- Special invisible ViewGroup
- Handles View positioning behavior
- Many specialized classes available
Example Layouts: ConstraintLayout, FrameLayout, ScrollView, LinearLayout, RelativeLayout
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What Activity class method is typically used in the activity’s onCreate() method to create a window in which you can place the UI?

A
Overloaded Method: setContentView()
  void setContentView(int layoutResourceId);
  void setContentView(View view);
  void setContentView(View view, ViewGroup.LayoutParams params);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What Activity class method retrieves widgets in a UI?

A

findViewById(@IdRes int id)

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

How are the application resources organized?

A

Using the auto-generated “R” class with nested classes for types of resources (such as “layout” and “id”).

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

What is an Adapter?

A

A class that manages the interactions between a View and its data

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

What is an Intent?

A

A messaging object you can use to request an action from another app component.

https://developer.android.com/reference/android/content/Intent

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

What are the characteristics of an implicit intent?

A

Implicit Intent Characteristics:

  • Action: Specifies the requested action
  • Data: Specifies data associated with the action
  • Mime Type: Specifies the type of data associated with the action
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the lifetimes within an Activity lifecycle?

A

Lifetimes within Activity lifecycle

  • onCreate() (start total lifetime)
    • onStart() (start visible lifetime)
      • onResume() (start foreground lifetime)
      • onPause() (end foreground lifetime)
    • onStop() (end visible lifetime)
  • onDestroy() (end total lifetime)
  • onRestart() (restart visible lifetime)
    • called after onStop() and before onStart()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the three fundamental use cases for intents?

A

Three fundamental use cases:

  • Starting an activity
  • Starting a service
  • Delivering a broadcast
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you set the Data and Mime Type characteristics of an implicit intent?

A
  • Intent.setData() to set the Data (also clears the Mime Type)
  • Intent.setType() to set the Mime Type (also clears the Data)
  • Intent.setDataAndType() to set both
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does APK stand for?

A

Android PacKage file

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