Android Views

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/41

flashcard set

Earn XP

Description and Tags

Flashcards from Android Views lecture

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

What is a View in Android?

Every visible component on the screen, serving as the basic building block for UI components.

2
New cards

What does the View class do?

Represents the basic building block for user interface components and the base class for classes that provide interactive UI components such as buttons, checkboxes, and text entry fields

3
New cards

What are the key properties of a View?

A location (left, top coordinates), width, and height, measured in density-independent pixels (dp).

4
New cards

How are Views arranged in a window?

In a single component tree, specified in code or XML layout files.

5
New cards

What is a TextView?

A user interface element that displays text to the user, similar to a Label.

6
New cards

What are the options for layoutheight and layoutwidth in XML?

matchparent, wrapcontent, and exact values in dp.

7
New cards

What is an EditText?

A user interface element for entering and modifying text; a subclass of TextView.

8
New cards

What is the purpose of the inputType attribute in EditText?

Configures the keyboard type, acceptable characters, and appearance of the edit text.

9
New cards

What is an ImageView?

A View that displays image resources, like Bitmap or Drawable resources.

10
New cards

What does the setImageResource(int resId) method do?

Sets a drawable as the content of an ImageView.

11
New cards

What is the R class?

A class for accessing resources, including R.id, R.layout, R.drawable, R.array, R.string, R.color, and R.style.

12
New cards

What is a RadioGroup?

A class used to create a multiple-exclusion scope for a set of radio buttons. Checking one unchecks others in the same group.

13
New cards

What is a RadioButton?

A two-state button that can be either checked or unchecked, commonly used within a RadioGroup.

14
New cards

What is a CheckBox?

A two-state button that can be checked or unchecked, allowing users to select one or more options from a set.

15
New cards

What are key attributes for Chips?

android:checkable, android:text, app:chipIcon, app:checkedIcon, and app:closeIcon.

16
New cards

What does an Adapter object do?

Acts as a bridge between an AdapterView and the underlying data for that view, providing access to data items and responsible for creating a View for each item.

17
New cards

What are subclasses of AdapterView?

ListView, Spinner, and GridView.

18
New cards

What is an ArrayAdapter?

An adapter that provides views for an AdapterView, returning a view for each object in a data collection, commonly used with ListView or Spinner.

19
New cards

What is a Spinner?

A view that displays one item at a time and lets the user pick among them (drop-down), getting its items from an Adapter.

20
New cards

How does a Spinner handle item selection?

By implementing the OnItemSelectedListener interface and overriding the onItemSelected and onNothingSelected methods.

21
New cards

What is a ListView?

A vertically-scrollable collection of views, where each view is positioned immediately below the previous view in the list.

22
New cards

How does a ListView handle item clicks?

By implementing the OnItemClickListener interface, implementing the onItemClick method, and calling the setOnItemClickListener(this) method.

23
New cards

What is a RecyclerView?

A view for displaying a list or grid of data, optimizing performance by only processing and drawing visible items.

24
New cards

What are the required parts to implement a RecyclerView?

Data, a RecyclerView instance, an item layout, a layout manager, a view holder, and an adapter.

25
New cards

What are the steps for implementing a RecyclerView?

Add RecyclerView to layout, design each item's look/behavior, decide on data source, create item layout, create an Adapter class (extending RecyclerView.Adapter), define the view holder, arrange items with a LayoutManager.

26
New cards

What is the purpose of AndroidManifest.xml?

To register the activities in your app and define the Intent Filter

27
New cards

What does adding an activity to AndroidManifest.xml look like?

28
New cards

What is a launcher icon?

A graphic that represents your app to users, appearing in the list of installed apps and on the Home screen.

29
New cards

What are ways to share data between Android Activities?

Use Intent extras, store data persistently in external files or remote storage, create a subclass of Application, use a Singleton class, or define public static variables.

30
New cards

What are the primary pieces of information in an Intent?

Action (the general action to be performed) and Data (the data to operate on, expressed as a Uri).

31
New cards

How can Extra data be sent when starting another Activity?

Via public Intent putExtra (String name, Bundle value)

32
New cards

How can the value be retrieved with the key name?

String message = intent.getStringExtra(FirstActivity.EXTRA_MESSAGE)

33
New cards

What interfaces can be used to send the Class Type?

Serializable Interface or the Parcelable Interface (preferred)

34
New cards

When using Serialization method what interface must the calss type implement?

Serializable Interface

35
New cards

Which method is used to get the parcel object in the SecondActivity?

Use teh following method to get the parcel object in the SecondActivity: public T getParcelableExtra (String keyName)

36
New cards

What is the base class for maintaining the global application state?

Application Class

37
New cards

What is the subclass that can be created to extend the Application class?

Define a class to extend the Application class; see the coding example below
Add the attribute android:name=“ .GlobalData” under the tag in the AndroidManifest.xml

38
New cards

What is the centralize control that cannot be extended?

Singleton class

39
New cards

What is used to allow the client to get the instance?

public static synchronized GlobalData getInstance()

40
New cards

What is a Gradle Build Tool?

A fast, dependable, and adaptable open-source build automation tool with an elegant and extensible declarative build language.

41
New cards

Where can you extend Gradle?

To provide your own task types or even build models

42
New cards

What is used to represent the scope of a dependency?

Gradle represents the scope of a dependency with the help of a Configuration.