Skip to content
Back to skills

Android Persistence

ASecurity

Standards for Room Database and DataStore. Use when implementing Room database schemas or DataStore preferences in Android. (triggers: **/*Dao.kt, **/*Database.kt, **/*Entity.kt, @Dao, @Entity, RoomDatabase)

  • 43 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
ai-agentsdatabase

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ComeOnOliver/skillshub --skill android-persistence --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Android Persistence?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Android Persistence
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-android-persistence/badge)](https://www.skillsdirectory.com/skills/comeonoliver-android-persistence)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: android-persistence
description: "Standards for Room Database and DataStore. Use when implementing Room database schemas or DataStore preferences in Android. (triggers: **/*Dao.kt, **/*Database.kt, **/*Entity.kt, @Dao, @Entity, RoomDatabase)"
---

# Android Persistence Standards

## **Priority: P0**

## Implementation Guidelines

### Room

- **Async**: Return `Flow<List<T>>` for queries, use `suspend` for Write/Insert.
- **Entities**: Keep simple `@Entity` data classes. Map to Domain models in Repository.
- **Transactions**: Use `@Transaction` for multi-table queries (Relations).

### DataStore

- **Usage**: Replace `SharedPreferences` with `ProtoDataStore` (Type-safe) or `PreferencesDataStore`.
- **Scope**: Inject singleton instance via Hilt.

## Anti-Patterns

- **No IO on Main Thread**: Room handles dispatchers, but verify Flow is collected off-main.
- **No @Entity in UI Layer**: Map to Domain or UI models in Repository.

## References

- [DAO Templates](references/implementation.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…