Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: raywenderlich Tutorial Team, Aldo Olivares Dominguez, Jennifer Bailey, Dean Djermanović

Rating No ratings yet

No description

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on Android tutorial that walks you from raw file and preference storage up through SQLite, ContentProviders, Room, and Firebase, so you can pick the right persistence layer for each feature. Best for Android developers with basic Kotlin/Android experience who want practical, project-driven coverage of local and cloud data storage. 【Book Arc】 - **Opening (~0%–19%)**: Establishes the storage toolbox in the Android SDK — files (internal vs. external, with encryption), SharedPreferences for lightweight key-value settings, and the trade-offs that decide which to use. - **Early (~19%–32%)**: Dives into SQLite directly: schemas, CRUD operations, `SQLiteOpenHelper`, cursors, migrations, and unit testing the database layer with Robolectric. - **Early–Middle (~32%–48%)**: Introduces ContentProviders as a way to expose and share data across apps, covering contract classes, URIs, MIME types, and querying through the ContentResolver. - **Middle (~48%–60%)**: Transitions to Room, explaining its architecture (Repository, ViewModel, LiveData) and how it fits Google's recommended app architecture. - **Late (~60%–85%)**: Covers Room's practical mechanics — entity definitions, relationships, the DAO pattern, and schema migrations. - **Ending (~85%–100%)**: Moves to Firebase, covering the Realtime Database, reading/writing data, offline persistence, and usage/pricing considerations. 【Key Takeaways】 - **Storage choice is a design decision, not a default** (Opening): Internal storage for private data, external for shareable files, and preferences for small settings — each has distinct uninstall and access behavior. - **SQLite is the foundation Room abstracts** (Early): Understanding schemas, CRUD, cursors, and `SQLiteOpenHelper` makes Room's conveniences legible rather than magical. - **Migrations matter more than schema creation** (Early): The book stresses migrating rather than dropping tables, a habit that prevents data loss in production apps. - **ContentProviders enable cross-app data sharing** (Early–Middle): Contract classes, URIs, and MIME types form the interface other apps query through the ContentResolver. - **Room fits into a layered architecture** (Middle): Repository bridges data sources and app; ViewModel bridges repository and UI; LiveData observes changes — a pattern that scales as apps grow. - **Relationships and DAOs are where Room earns its keep** (Late): Entity definitions, relations, and the DAO pattern replace boilerplate SQL with type-safe Kotlin. - **Firebase trades control for convenience** (Ending): Realtime Database offers sync and offline persistence, but pricing and usage models should inform when to use it. - **Testing the data layer is part of the job** (Early): The book includes unit testing database operations, reinforcing that persistence code deserves verification. 【Reading Tips】 - **Skim Section 1 if you already know SQLite** — but read the migration and testing subsections carefully; those are where real bugs live. - **Deep-read the Room chapters (5–10)** — this is the book's core value and the architecture patterns (Repository/ViewModel/LiveData) apply beyond Room. - **Treat Firebase chapters as a decision guide** — focus on offline capabilities and pricing to judge whether it fits your app, not just the API calls. - **Follow along with the sample projects** — the book is tutorial-driven; reading code without running it loses most of the value. - **Watch for the Kotlin/Java framing** — SQLite examples assume prior Java familiarity; Kotlin readers should note the translation. 【Coverage Limits】 This guide is based on stratified excerpts covering the table of contents and portions of Sections 1–3; specific chapter details beyond the sampled chunks (particularly later Firebase chapters and some Room internals) are not fully represented.
Excerpt 1
Android Ge_ng started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Key points . . . . . . . . . . . . . . . ....
View in text
Excerpt 2
add the code to create a Cipher and encrypt the data to be stored and place the data, the salt and the iv into HashMap map to be returned by the method. // 1...
View in text
Excerpt 3
dler.kt and add the following code inside the class, after deleteToDo(): // 1 fun clearDbAndRecreate() { clearDb() onCreate(writableDatabase) } fun clearDb()...
View in text
Excerpt 4
hrough the same content provider. 10. Congratulate yourself! You just created two apps that are sharing the same data, think of the possibilities! :] Key Poi...
View in text
Excerpt 5
entities since it is often easy to infer from the context. In Crow's Foot notation, it is usually omitted. Cardinality Last but not least, the cardinality te...
View in text
Excerpt 6
om with Google's Architecture Components By Aldo Olivares In the previous chapters, you learned how to create the most important components of a Room Databas...
View in text
Excerpt 7
question_id") var questionId: Int, val text: String, val difficulty: String = "0", //Only this line changes val category: String = "android" ) Now, create a...
View in text
Excerpt 8
the Continue to console button now. Adding Real/me Database First, you need to create your database in the console. From the menu on the left select Database...
View in text
Tags
AI categories
AndroidDatabaseMobile
Publish Year: 2021
Language: English
File Format: PDF
File Size: 19.3 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…