Android

Room Database

Local database with Room: Entity, DAO, Database, Relations, Migrations, TypeConverters, LiveData and Flow

25 câu hỏi phỏng vấn·
Mid-Level
1

What is Room in Android?

Câu trả lời

Room is a persistence library that provides an abstraction layer over SQLite. It simplifies database access with annotations and generates code to avoid boilerplate. Room is part of Android Jetpack.

2

What are the 3 main components of Room?

Câu trả lời

The 3 main components of Room are: 1) Entity (represents a table), 2) DAO (Data Access Object, contains queries), 3) Database (abstract class containing database configuration and DAOs).

3

What is the @Entity annotation used for in Room?

Câu trả lời

@Entity marks a class as a database table. Each field in the class becomes a column. By default, the table name is the class name, but it can be customized with tableName.

4

How to define a primary key in a Room Entity?

5

What is the @ColumnInfo annotation used for?

+22 câu hỏi phỏng vấn

Nắm vững Android cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí