From d8ce4b3c0f383e844b125d2d3abd618715bb3c89 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 22 Jul 2026 08:08:58 +0000 Subject: Initial commit: Feeds, an Android RSS reader Feed subscriptions (RSS 2.0 + Atom, hand-rolled parser), OPML import/export, WorkManager periodic fetch with conditional GET, Room-backed local storage (feeds/articles/filter rules), keyword mute/highlight filtering. Reader mode: on-device extraction via Mozilla's Readability.js (vendored from github.com/mozilla/readability, pinned to release 0.6.0) run in a hidden WebView, for feed articles whose provided content is too thin to be the real article body. Save: explicit action (from a feed article, or the Android share-sheet target for any URL) archives to Stash via POST /artifacts?sync=true, while a local on-device copy (Readability-extracted) is always kept so saved articles read offline regardless of Stash's reachability. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL --- .../java/org/terst/feedreader/data/AppDatabase.kt | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/src/main/java/org/terst/feedreader/data/AppDatabase.kt (limited to 'app/src/main/java/org/terst/feedreader/data/AppDatabase.kt') diff --git a/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt b/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt new file mode 100644 index 0000000..8579341 --- /dev/null +++ b/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt @@ -0,0 +1,29 @@ +package org.terst.feedreader.data + +import android.content.Context +import androidx.room.Database +import androidx.room.Room +import androidx.room.RoomDatabase + +@Database( + entities = [FeedEntity::class, ArticleEntity::class, FilterRuleEntity::class], + version = 1, + exportSchema = false +) +abstract class AppDatabase : RoomDatabase() { + abstract fun feedDao(): FeedDao + abstract fun articleDao(): ArticleDao + abstract fun filterRuleDao(): FilterRuleDao + + companion object { + @Volatile private var instance: AppDatabase? = null + + fun get(context: Context): AppDatabase = instance ?: synchronized(this) { + instance ?: Room.databaseBuilder( + context.applicationContext, + AppDatabase::class.java, + "feedreader.db" + ).build().also { instance = it } + } + } +} -- cgit v1.2.3