Learning

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1.

BEGIN

 extension functions: vd fun Int.isOdd(): Boolean {}


 all classes are final
 basic app project: activity, resources, gradle files.
 Which method changes the image resource for an ImageView in Kotlin code?
setImageResource()
 Which method on an Activity inflates the app's layout and makes its views
available as objects? setContentView()
 Which of the following accessibility tools comes built in with most Android
devices? TalkBack
 Which Gradle configuration indicates the most recent API level your app has
been tested with? targetSdkVersion

2. LAYOUT

2.1. ConstraintLayout

 rcm default layout for Android; solves costly issue, allowing complex
behavior.
 position and size views: using constraints (click and drag to add cons)
 avoid findViewById(): use data binding instead:
Val binding: ActivityMainBinding
binding.name.text = …
binding.age.text = …

2.2. RecyclerView: displaying lists

 support animations and transitions


 Adapter: supplies data and layouts that the RV displays
getItemCount, onCreateViewHolder, onBindViewHolder
 if item is offscreen -> put in a pool to be recycled
 Which of the following is a ViewGroup? LinearLayout
 Which of the following listed view hierarchies is not valid? TextView >
TextView, ImageView, ScrollView
 Styles are resources defined in styles.xml. Using styles, you can define colors,
fonts, text size, and many other characteristics of a view.
 A View can contain any number of View or ViewGroup as its children. False,
View can have exactly 1 child
 What is EditText a subclass of? TextView
 Which one of the following statements is true about Button views? Button
views are clickable, and on click, the attached click listener performs an action.
 Which of the following constraint types expands a view only as much as needed
to fit its contents? Wrap content
 Which of the following visibility attribute values, if set on a view, makes it so
the view is hidden and does not take up any space in the layout? gone
 In a ConstraintLayout, which of the following choices describes the constraints
needed to keep a view in place during runtime? At least one horizontal and one
vertical constraint.
 Which of the following is not a reason for minimizing calls to findViewById()?
Your app is less likely to crash.
 Which is the correct way to reference bound data in the XML layout?
android:text="@={myDataClass.property}"
 What are some benefits of using the Layout Editor in Android Studio?
Drag and drop UI elements onto the screen with the visual design editor
Edit view attributes
Select device type and size for the preview of your layout

3. APP NAVIGATION (ĐIỀU HƯỚNG TRONG ỨNG DỤNG)

 Explicit intent (rõ ràng):


Fulfills a request using a specific component
Navigates internally to an Activity in your app
Navigates to a specific third-party app or another app you've
written
 Implicit intent (ngầm):
 App bar, navigation drawer and menus:

You might also like