Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
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.
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...
dler.kt and add the following code inside the class, after deleteToDo(): // 1 fun clearDbAndRecreate() { clearDb() onCreate(writableDatabase) } fun clearDb()...
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...
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...
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...
question_id") var questionId: Int, val text: String, val difficulty: String = "0", //Only this line changes val category: String = "android" ) Now, create a...
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...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Saving Data on Android (raywenderlich Tutorial Team etc.)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Saving Data on Android (raywenderlich Tutorial Team etc.)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Saving Data on Android (raywenderlich Tutorial Team etc.)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment