Provides daily devotional reading content from multiple sources (primarily Indonesian devotional publishers). Articles are downloaded on demand and cached locally in the database.
Alkitab/src/main/java/yuku/alkitab/base/ac/DevotionActivity.java— Devotion reader UIAlkitab/src/main/java/yuku/alkitab/base/devotion/DevotionDownloader.kt— Background downloader (single-threadExecutorService+LinkedBlockingDequequeue with clean shutdown)Alkitab/src/main/java/yuku/alkitab/base/devotion/DevotionArticle.java— Abstract base class- Article implementations:
ArticleMorningEveningEnglish,ArticleFromSabda,ArticleMeidA,ArticleRoc,ArticleRenunganHarian,ArticleSantapanHarian
DevotionDownloader runs work on a single-thread ExecutorService, fed by a LinkedBlockingDeque (so a take() provides natural backpressure):
- Endpoint:
GET /devotion/get?name={kind}&date={yyyymmdd}viaConnections.downloadString(url) - Queue supports both LIFO (front) and FIFO (back) insertion for prioritization
shutdown()sets avolatileflag and callsexecutor.shutdownNow(); the loop handlesInterruptedExceptionby re-interrupting and breaking- Articles cached in the
Devotiondatabase table touchTimetracks access for cache management- On completion the downloader emits an
AppEventsSharedFlowevent
Each article type has its own parser that:
- Extracts the HTML/text body from the server response
- Converts internal verse references (URLs) to verse callback spans
- Handles links to other devotional articles
- Separates web links from internal verse navigation links
Configured per-flavor in AppConfig via R.xml.app_config. The Indonesian version (yuku_alkitab) includes multiple devotion sources; the English version (yuku_quick_bible) includes Morning & Evening.
The Devotion table stores:
name— devotion kind identifierdate— article date (yyyymmdd)body— cached article contentreadyToUse— whether download is completetouchTime— last access timedataFormatVersion— schema version for migration