Android Flashcards
What is an Activity?
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
What is a View?
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
What is a ViewGroup?
A ViewGroup is a special View that holds other views
What is a Layout?
Layout - Special invisible ViewGroup - Handles View positioning behavior - Many specialized classes available Example Layouts: ConstraintLayout, FrameLayout, ScrollView, LinearLayout, RelativeLayout
What Activity class method is typically used in the activity’s onCreate() method to create a window in which you can place the UI?
Overloaded Method: setContentView() void setContentView(int layoutResourceId); void setContentView(View view); void setContentView(View view, ViewGroup.LayoutParams params);
What Activity class method retrieves widgets in a UI?
findViewById(@IdRes int id)
How are the application resources organized?
Using the auto-generated “R” class with nested classes for types of resources (such as “layout” and “id”).
What is an Adapter?
A class that manages the interactions between a View and its data
What is an Intent?
A messaging object you can use to request an action from another app component.
https://developer.android.com/reference/android/content/Intent
What are the characteristics of an implicit intent?
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
What are the lifetimes within an Activity lifecycle?
Lifetimes within Activity lifecycle
- onCreate() (start total lifetime)
- onStart() (start visible lifetime)
- onResume() (start foreground lifetime)
- onPause() (end foreground lifetime)
- onStop() (end visible lifetime)
- onStart() (start visible lifetime)
- onDestroy() (end total lifetime)
- onRestart() (restart visible lifetime)
- called after onStop() and before onStart()
What are the three fundamental use cases for intents?
Three fundamental use cases:
- Starting an activity
- Starting a service
- Delivering a broadcast
How do you set the Data and Mime Type characteristics of an implicit intent?
- 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
What does APK stand for?
Android PacKage file