Skip to content

Memorize (احفظ) and Prayer Corrector: offline, private Quran recitation tracking - #3934

Open
amrfahmyt1983-wq wants to merge 33 commits into
quran:mainfrom
amrfahmyt1983-wq:feature/offline-memorize
Open

amrfahmyt1983-wq wants to merge 33 commits into
quran:mainfrom
amrfahmyt1983-wq:feature/offline-memorize

Conversation

@amrfahmyt1983-wq

@amrfahmyt1983-wq amrfahmyt1983-wq commented Oct 22, 2026 •

Copy link
Copy Markdown

📖 Memorize · احفظ  &  🕌 Prayer Corrector · مصحح الصلاة

Recite from memory with the mushaf page open: the words disappear, and come back as you say them.

Stuck? Sheikh Al-Husary gives you the next word. Fully offline, fully private.

📴 Offline 🔒 Private 🎙️ One tap 🕌 Hands-free in salah 🎧 Husary's voice 📊 Progress 🌍 Arabic and English
works in airplane mode audio never leaves the phone a floating mic starts it where you are screen off, prayer phrases ignored Murattal, Muallim, Mujawwad reading cycles, charts, a daily reminder; tablets too full UI in both

On a phone in night mode: tap the green mic, the page is hidden, the words of Al-Mulk come back as Al-Husary recites; a wrong passage gets a red mark, then the word is given; the session is paused from the mic
Recorded on a Xiaomi Mi 11 in night mode. Tap the green mic, and the words are hidden. Al-Husary recites Al-Mulk, and they come back as they are said. A wrong passage gets a 🔴 mark, and then the word is given. Then the session is paused from the mic.

🧭 What this PR adds, in one minute

What Where to look
📖 Memorize: hide the page and recite from memory; each word comes back as you say it the tour, Features
🗣️ Prayer corrector: wrong words marked, the next word given in Al-Husary's voice, hands-free in salah Features, How it works
📗 Recitation: read with the page shown, a trail follows you, mistakes marked and corrected the tour
🚫 No ayah left out: skip an ayah and the session holds there until you come back the tour, Tested
📼 Recording sessions and Record and contribute: play a session back on its own mushaf pages the tour
📊 Progress: reading cycles (khatma), pages and minutes per day, a daily reminder, Memorizing, Salah and Sessions the tour
🔖 Eight reading bookmarks, each with a name, a purpose and days to finish the tour
📄 All seven of the store app's page types, and Memorize on each of them the tour
📱 Tablets and phones: one APK, three panes on a 12″ tablet, one pane at a time on a phone the tour, Tested
🔧 Fixes outside Memorize: the stuck reading bookmark toast, double-mirrored back arrows in Arabic Changes not directly about memorization

Everything runs on the device: no account, no server, and nothing recorded unless you turn it on.

📸 Screenshots

Taken on a Xiaomi Mi 11 (Android 14), in night mode, with a Husary recording played in place of the microphone.

① The mic is ready 🟢 ② Tap it: the words are hidden ③ …and come back as you recite ④ A wrong word is marked, not shown
⑤ The next word is given ⑥ Paused: end, or listen to yourself ⑦ Your settings ⑧ Your recordings

While listening in the background, the notification shows only where you are, never what was heard, and whether you are being recorded:

On the Madani mushaf with tajweed colors, the experimental page type this PR adds. Same phone, release build, a recitation played aloud from a laptop:

By day: ready By day: as you recite At night: hidden At night: as you recite Recited elsewhere: 🔴 A word given

The words come back in their tajweed colors. Night mode uses the app's usual filter, which inverts the page's colors, as quran.com's app does.

بالعربية: the full interface in Arabic
جاهز تلميح بالكلمة التالية إيقاف مؤقت الإعدادات تسجيلاتي

A tour of the PR in pictures

Real screenshots unless marked otherwise: a Xiaomi Mi 11 (Android 14) and Firebase Test Lab's real and virtual devices. "Rendered" means drawn by the PR's screen tests (-Pmemorize.render, -Pprogress.render).

🎙️ Starting a session: the mode window

Tapping the green mic (or Recite from here on an ayah) opens a small window. It says where the session starts and whether it will be recorded, and offers Memorization or Recitation. A long press on the mic adds In prayer (salah). On a tablet the choices sit side by side as cards.

Mi 11, at night Galaxy S24 (real, Test Lab), with salah A tablet in landscape (rendered)

🚫 No ayah is left out

If you go on to a later ayah without reciting one, Memorize holds at the first word of the ayah you skipped. The word is marked, and given after the hint delay, until you come back to it. Ayat that sound alike (2:149 and 2:150 open with the same eight words) no longer pull the session ahead, and going back to the start of an ayah is followed as a restart. Inside an ayah, a setting decides whether a word or two may pass (the default) or every word must be heard.

2:149 left out: the session holds at it A restart, followed The setting

Over the air on the Mi 11: Husary's recitation played from a laptop, heard by the phone's microphone (bench/noskip_ota.py).

📗 Recitation mode

For reading with the text shown. Nothing is hidden: the words you have read get a light trail, and skipped words and mistakes are marked. After a mistake, the correct word is said in Al-Husary's voice once the hint delay has passed. Both are switches in Settings, next to Memorize's own.

Recitation: the trail follows the reader Memorize's settings, with Recitation's two switches

📼 Recording sessions

Settings > Recording sessions lists what you recorded, by day: the mode, the passage, the time and length, and whether it was recorded to contribute. A session opens in a window that plays it back on its own mushaf pages: the page turns with the word being heard, hints, skipped words and mistakes are marked, and tapping a word plays from it. A timeline under the player shows where the hints, skips and mistakes fell. On a tablet the list and the session sit side by side, and on a phone held sideways the player sits beside the page.

The list (rendered)

📊 Progress on a phone

Menu > Progress, or the chart button on a reading bookmark in the Bookmarks tab. For each reading bookmark:

  • the juz line: where the bookmark is, what was read this cycle, and where a steady pace would be today;
  • the days: pages read above the day numbers and minutes read below, each bar with its number, today darker;
  • the facts: time read this cycle, the last khatma, and the daily reminder.

Memorizing counts the ayat you hold (recited every word without a hint the last time), by juz and sura. Sessions lists every session, ayah by ayah. Everything is kept on the device.

A bookmark's cycle Its facts and reminder Sessions One session, ayah by ayah Memorizing

In Arabic, the chart button sits on the reading bookmark's row, and the charts read right to left:

The Bookmarks tab, with the chart button The bookmark's Progress

On the Mi 11, with 12 days of sample history from the debug build's "seed" setting.

📱 Progress on tablets

On a tablet in landscape, Progress has three panes: the sections, the bookmarks, and the one chosen. A small tablet gets the rail and two panes, a phone one pane at a time, and a phone held sideways gets three panes too.

Progress, on a tablet and a phone. These are Firebase Test Lab virtual devices: a 1280 × 800 dp tablet in landscape, which gets the same three panes as a 12″ MatePad 12 X, and a phone. Both have 12 days of sample reading. The teal bookmark is 13 pages behind a 30-day pace. Pages per day are above the axis and minutes below.

Tablet, by day Tablet, in Arabic at night
Phone, at night Phone, in Arabic

On real tablets and phones. The same release APK on Test Lab's real devices, right after install: no bookmark is placed yet, so Progress shows faded sample days.

Lenovo Tab P12 (12.7″), landscape: three panes
Galaxy Tab A7 Lite: rail and two panes Galaxy S24: a Memorize session
Salah on a tablet Sessions on a tablet
A phone held sideways (rendered)

🔖 Eight reading bookmarks

Teal, orange and red stay as they are, and sync with the user's account. Green, blue, purple, brown and grey are new and stay on the device. Each has a name, a purpose (reading, memorization or review) and the days to finish a cycle in. They are placed from an ayah's menu, underlined on the page, listed in Bookmarks, and kept in backups. The toast after moving one now has an ✕ and goes away by itself.

The editor Green turned on Placing one from the ayah menu Green underlined
The first-time explanation, with ✕ Several colours on one page (Galaxy S24)

📄 Page types

Settings > Page Type now offers all seven of the store app's page types, in a fixed order, opening on the one in use: Madani, Madani with tajweed colors, the 1421 and 1440 prints, two line-by-line prints, and Shemerly. Each downloads its pages the first time, from quran.com's public file server. Memorize works on all of them: word by word on Madani and tajweed, ayah by ayah on the others, whose pages have no word boxes.

The picker Shemerly (page 512) Memorize on Shemerly: Ad-Duha 1–5 recited

🔧 Fixes you can see

Arabic: the back arrow points the right way (Audio manager)

✨ Features

🎙️ A floating mic

  • On the reading page, a green mic starts a session where you are. Tapping it opens a small window: Memorization or Recitation, with where the session starts and whether it will be recorded. A long press adds salah.
  • While it listens it is blue and pulsing, with a red dot when you chose to record. Tap it to pause or resume.
  • When paused, ✕ ends the session and ▶ plays back what you recited.
  • Drag it anywhere. The audio bar's mic and "Recite from here" open the same window. The toolbar's Memorize action starts memorizing right away.

📖 Memorize mode

  • The words are hidden as soon as you start, on the real mushaf page.
  • Start anywhere, from three pages before the page you are on to three pages after. The app finds where you began and shows the words before it again.
    • If what you recite isn't there, the first word of your page is marked 🔴.
  • Each word reappears the moment you say it, typically within half a second.
  • It keeps going. At the end of a sura the session goes on into the next one: the page turns, the next sura is already hidden, and the basmala is expected. It ends when you end it.
  • Repeating a phrase, going back a few words, or starting with the isti'adha and basmala is all fine. Recitation is followed naturally, not word-for-word strictly.
  • No ayah is left out. If you go on to a later ayah without reciting one, the session holds at the skipped ayah's first word. That word is marked, then given after the hint delay, until you come back. Ayat that sound alike no longer pull the session ahead, or back to a phrase the ayah before also has. This was tested at all 458 pairs of nearby look-alike ayat.
    • A setting decides whether a word or two may pass inside an ayah (the default) or every word must be heard.

📗 Recitation mode

  • Read with the text shown: nothing is hidden. The words you have read get a light trail.
  • Skipped words and mistakes are marked. After a mistake, the correct word is said in Al-Husary's voice once the hint delay has passed.
  • Marking mistakes and saying the word are two separate switches.

🗣️ Prayer corrector

  • A wrong word is marked in red, without being revealed, so you get the chance to correct yourself.
  • If you don't, or if you are stuck, the next word is revealed and spoken in Al-Husary's voice. Get the same word wrong again, and it is given at your next pause.
  • Still stuck? It gives one more word at a time. After three, it gives the rest of the ayah if it is short, or the rest of the line, as your mushaf breaks its lines.
  • A 💡 button in the audio bar gives a word on request.

🕌 Salah mode

  • Start it before the prayer and put the phone down: it keeps listening with the screen off.
  • Al-Fatiha, takbir, ruku, sujud and tasleem are ignored. The corrector only helps while you recite the passage. It continues across rak'ahs, and into the next sura (taraweeh).
  • In salah it is more careful:
    • hints are one word at a time, spoken at your pause, never over you
    • it goes quiet after three, since a long silence is usually ruku or sujud
    • the passage's start isn't looked for while Al-Fatiha is recited

✅ Double-check before correcting (optional)

  • A second, larger model listens again before the corrector speaks a hint, and before it marks a mistake. It hears the last 8 seconds, with all their context. If you did say the word, nothing is corrected.
  • Off by default, a one-time 92 MB download. The setting says whether it is recommended for your phone, and why:
    • recommended with a 64-bit processor and about 6 GB of memory or more;
    • once it has run, by how long a check takes on your phone (not above 1.5 s).
    • Where it suits the phone, it is also offered with the first model download and in Download for offline use.
  • In tests it removed about half of the wrong marks and a third of the wrong hints in mosques, without missing more words.

📼 Record and listen to yourself (opt-in)

  • Off by default. You can record always, or be asked each time.
  • One recording per sura or per session, named by where it starts and ends, for example "Al-Mulk 1–15". Keep them until you delete them, or let a new recording replace the older one of the same place.
  • Recording sessions (in Settings) lists sessions by day. Swipe one to delete it, with Undo.
  • A session plays back on its own mushaf pages:
    • the page turns with the word being heard;
    • hints, skipped words and mistakes are marked;
    • tap a word to play from it.
  • Export a zip with:
    • the audio
    • an alignment.json with every word's time, whether it was recited, hinted or missed, and its phonemes
    • a NVIDIA NeMo manifest.jsonl of the ayat you recited entirely, ready for training speech models
  • Record and contribute is a switch with a one-time explanation. When it is on, every session is recorded. Its recordings keep what the speech model heard and what the app decided (<id>.heard.jsonl), for improving the models. Nothing is sent: the user exports it.

📊 Progress

  • Open it from the main menu, or from the chart button on a reading bookmark in the Bookmarks list.
  • For each reading bookmark it shows:
    • pages per day: how far the bookmark moved;
    • minutes per day: time with a page open in the reader, paused after 3 minutes without a page turn or touch;
    • where the cycle stands on a juz line, against its pace;
    • the total reading time, and the last cycle's dates.
  • A cycle (khatma) starts on its own when the bookmark goes from the last suras back to Al-Fatiha. An Undo within a minute cancels it.
  • A daily reminder comes at the time you choose (8 PM by default) to finish within the cycle's days, for example "13 pages behind…". It stays quiet while the reader is open, or once today's pages are read.
  • Memorizing shows the ayat held per juz and sura: an ayah is held when, the last time you memorized it, you recited every word without a hint.
  • Salah and Sessions give every session's result by day. Recorded sessions open in Recording sessions.
  • Eight reading bookmarks.
    • Teal, orange and red stay as they are, and synced.
    • Green, blue, purple, brown and grey are kept on the device.
    • Each has a name and a purpose (reading, memorization or review), set in Settings.
    • The new ones work like the first three: the ayah menu, underlines, the Bookmarks list and backups. Old backups still restore.
  • On tablets Progress has three panes: a rail, the list and the details, as on a 12″ MatePad 12 X. Phones show one pane at a time. Memorize's mode window and Recording sessions also use the width, and a session has a timeline beside its player. On a phone held sideways, the session's mushaf page takes the height and the player sits beside it.
  • Until a bookmark has moved (or before it is placed at all, as right after installing), its days are faded sample days marked "Sample data", so the charts are there from the first open.
  • Progress keeps everything on the device. A setting turns the session log off and clears it.

📥 Downloads, your way

  • Download automatically: the model, and the hint voice for the suras you reach, in the background, so you are never stopped.
  • Download for offline use: the model and the hint voice for the whole Quran in one go, with the size shown. The start dialog also offers the whole Quran.
  • Import the model without internet: pick each file on its own, or the .zip it came in. Files are recognized by their SHA-256.
  • A download whose connection drops, or that comes short, is tried again by itself (three tries). A file that isn't the pinned one fails at once.

📄 Every page type, and colored mushafs

  • Which glyphs are words is worked out for the page type in use, from its own glyph boxes and the text. On the madani pages this reproduces the exact word table for all 6,236 ayat at every width.
    • On the real tajweed layout (its marks are placed differently in 2,638 ayat), it tells words apart in 6,232 of 6,236 ayat. The other 4 have no end marker of their own, so they are hidden ayah by ayah.
  • Memorize also works on the page types this PR adds (below). Where a page has no word boxes, it goes ayah by ayah: the newer prints, Shemerly and line-by-line pages. On Shemerly an ayah can run on to the next page, and is marked on both.
  • Marks are backgrounds under the words (🔴 mistake, teal hint, amber skipped), so a tajweed-colored mushaf keeps its colors.

🔒 Private by design

  • Audio is processed in memory only. Nothing is logged or sent, and nothing is recorded unless you turn recording on. Recordings stay in the app's no-backup storage and only leave the phone if you export them.
  • Progress keeps its data in the app's own database, like bookmarks: bookmark moves, reading time, and each session's passage, mode, date, length and counts. No audio and no heard words are kept there.
  • The only downloads are the speech model (once, 69 MB), and, if you want them, the hint voice's sura files (through the app's own audio downloads) and the double-check's model (once, 92 MB).

🧭 How it works

flowchart LR
    mic["🎙️ Microphone<br/>in memory only"] --> asr["🧠 Speech model<br/>streaming phonemes"]
    asr --> tracker["🧭 Tracker<br/>finds where you started,<br/>follows the expected words"]
    tracker --> hints["⏱️ Hint scheduler<br/>mark → wait → next word"]
    hints --> page["📖 Mushaf page<br/>words reappear · mistakes marked"]
    hints --> voice["🔊 Al-Husary<br/>speaks the next word"]
    mic -. "only if you chose to record" .-> rec["📼 Recording<br/>+ word alignment"]
Loading
When… On screen In salah
a word is wrong 🔴 marked now, given after T s given after T s, at the reciter's next pause
the same word is wrong again given at your next pause given at your next pause
you stop mid-ayah given after T s given after T s
you stop between ayat given after T s given after 2 × T (often ruku)
still stuck after 3 words the rest of the ayah or line quiet until you continue

T is 4 s by default. With the double-check on, each hint and mark is checked first (about 0.7 s).

When a session doesn't follow, it can say why: adb shell setprop log.tag.MemorizeTrace DEBUG logs what it heard and decided (start search, salah phases, words, mistakes, hints). It is off by default, for developers only.


✅ Tested on real phones and real voices

Over the air on a Xiaomi Mi 11. Recitations were played from a laptop's speakers, and the phone's own microphone heard them in real sessions. Each clip was played clean, and again with room noise around it, about 10 dB below the voice (living room, café, kitchen, street, meeting, car).

🎙️ Readers 📖 Words revealed: clean 🔊 With room noise
9 professional recitations: Al-Husary, Al-Afasy, Abdul Basit (mujawwad), Badri (fast hadr), Ali Jaber, Ayyub, Mandour (live), Al-Luhaidan (live, echoing), Al-Minshawi's class (children repeating) 98.6 % 95.3 %
Continuous: Al-Ikhlas → Al-Falaq → An-Nas with their basmalas 58 / 58 58 / 58
Non-professional readers 100 % 84 %
Mosque prayers (4, in salah mode, 60 s each) 4 / 4 followed, 0 spoken hints 4 / 4 followed, 0 spoken hints
Non-native readers (11, from 9 countries) 32 % 32 %

Whole prayers, over the air on the Mi 11. These are YouTube recordings from mosques, used for evaluation only and never redistributed. They are two complete prayers, with every rak'ah's takbir, Al-Fatiha, passage, ruku and sujud, in salah mode with the default delay.

🕌 Prayer ⏱️ Length 📍 Start found 📖 Followed 🔊 Spoken hints 🔴 Marks
Hud 11:36 → 52 9.5 min 11:36, as the imam began 278 words, every rak'ah 1 3
Yusuf 12:68 → 105 12.4 min 12:69 586 words, every rak'ah 2 24
Yusuf, with the double-check 12.4 min 12:77 ¹ 586 words, the same 2 1

¹ The first minutes of that run were garbled by the laptop's audio, after a run was stopped mid-playback. In clean runs, with and without the check, the start was 12:69.

The double-check on the same phone: a check takes about 0.7 s. Its model runs in a separate process that peaks at about 330 MB, and the app's own memory doesn't change. On 5½ minutes of the Yusuf prayer, played twice with the check and once without, the session followed the same 213 words each time, with 1 and 0 wrong marks against 4. In the lab, on 3 hours of mosque prayers and on users' phone recordings, it cut:

  • false hints by 28 % (43 % while reciting);
  • recordings with false mistake marks by 57 %;
  • correct clips by non-native readers that were flagged, from 13.8 % to 6.2 %.

It never dropped a hint that was needed in 400 real stalls, and recall was unchanged.

The release build, used like a user would (R8, one app process for every session). Each clip was played after going to its page and starting from the floating mic, and scored from the session's diagnostics trace. Over 53 sessions:

  • No crash, ANR or hang. The 12-minute Yusuf prayer was followed to 12:104.
  • Memory stays flat: 347 MB after the 53 sessions. Testing this way found and fixed a leak: every reading screen opened had stayed in memory with its pages, 31 MB each. LeakCanary's path ran through the audio bar's collectors, which are never cancelled (already so before this PR), to Memorize's presenter and on to the screen. The presenter now lets go of the screen when it closes.

In Firebase Test Lab (Test Lab): whole sessions, fed a recitation in real time through the real engine, tracker and hint scheduler.

📱 Phone ⚡ Speed ⏳ Model load 📖 Husary, Al-Mulk 1–5 ⏱️ Word appears after (median / 90 %)
Galaxy A10 · 2019 entry level · Android 10 2.4 × faster than real time 7.3 s ¹ 60 / 60 words · 0 hints 0.34 s / 0.63 s
Galaxy S21 · Snapdragon 888 14 × faster than real time 2.1 s 60 / 60 words · 0 hints 0.16 s / 0.46 s
Virtual phones · Android 14 and 16 KB-page Android 16 15–20 × 1–2 s 60 / 60 words · 0 hints 0.13–0.15 s / 0.44–0.46 s

The double-check on Test Lab's virtual phones (Android 14, and Android 16 with 16 KB pages) and on the Mi 11:

  • it downloads and converts its model on the device;
  • it finds 5 of 5 words said and rejects a word from another sura, in 0.3–0.8 s;
  • the speech engine hears exactly the same with checks running next to it.

Android 16 caught a bug the Mi 11 hadn't shown: the audio sent to the check's process was too big for a binder message, and now goes through a file. A Robo crawl of the release APK found no crash on Android 8.0 or 14.

¹ Listening starts immediately: what you say while the model loads is kept and shown as soon as it's ready.

During development, on recordings not used to build the app:

  • 97.2 % of words revealed over 6 hours of studio, live and prayer recordings (QUD benchmark).
  • 98.7 % on real users' phone recordings (Tarteel's held-out set in the Quran-Lab benchmark).
  • Salah mode on 3 hours of real congregational prayers: 97.6 % of the passage followed.

No ayah left out was tested in the lab and live.

  • In the lab, at all 458 pairs of nearby ayat that are alike:
    • correct passages followed cleanly: 133 → 139 of 245;
    • restarts: 281 → 288 of 432.
  • Live on the Mi 11, in 46 cases at 14 such places: wherever the session had started, it held in what was left out.
  • Two places can't be told apart by sound:
    • 94:6 is heard as 94:5, which differs only by its ف;
    • 26:139–140 repeat 26:121–122 word for word.
  • A start dropped after a misheard word now stays where the user was. Live, 5 of 6 places that used to lose the reciter now pass.
  • That start is taken up again as soon as the word there, or the one after it, is heard clearly. Before, the search needed three clear words in a row again.
    • Replayed on all 178 Memorize and Recitation sessions the Mi 11 heard, 12 change. False "recited elsewhere" marks go, and 102:3–4 is followed where the session used to jump ahead to 102:5.
    • 102:3 and 102:4 differ by one word (ثم), so a session there can still take one for the other.

Page types on the Mi 11 (release build): all seven are in the picker; Shemerly downloaded (114 MB) and showed; Memorize followed Husary's Ad-Duha over the air, ayah by ayah (93:1–5), with the ayat before the start shown again.

Progress was checked on the Mi 11 in English and Arabic:

  • reading time counted while reading;
  • the daily reminder's notification;
  • a green bookmark placed and underlined;
  • live Memorize sessions logged and shown.

In Test Lab:

  • screenshots on a tablet in landscape and on a phone, in both languages and both themes;
  • the release build's session test on a tablet and a 16 KB-page Android 16 phone: 98.6 % revealed, and the double-check 5/5;
  • Robo crawls of the release build through Progress, the bookmark editor and the reader: no crash and no ANR.

On tablets and phones (Test Lab, the minified release build, one APK for both):

  • Robo crawls into Progress, then around the app, on real devices: a Lenovo Tab P12 in landscape, a Galaxy Tab A7 Lite and a Galaxy S24. Also on virtual tablets in both orientations, phones upright and sideways, a small phone, and Android 8.
  • The session suite on a real Pixel Tablet and Galaxy A05s, and on an Android 17 phone.
  • Two crawls found a crash in Settings > Advanced Options, caused by this PR's eight-colour change. Moshi looks ReadingBookmarkType's constants up by name, and once the enum had a field, R8 renamed them. @JsonClass(generateAdapter = false) keeps them, and the tablet that crashed now opens the screen.
  • On the budget A05s the double-check's 92 MB download broke off, so downloads now retry.

Unit and integration tests follow TESTING_STRATEGY.md: fakes not mocks, and virtual time. The tracker is golden-tested against its reference implementation, with real recordings as fixtures for the cases found live. The full suite passes: 952 tests, plus device tests for the double-check and the Progress screens.


🧠 Speech model and license

Model Quran-Lab zipformer_p-arabic-v3.1: streaming phoneme recognizer, int8, 69 MB
License Quran-Lab No-Profit License 1.2, included verbatim in feature/memorize/MODEL_LICENSE: free to use and share, never sold or put behind a paywall
Delivery downloaded once from a pinned, SHA-256-verified URL, or imported from files
Runtime sherpa-onnx (Apache-2.0), on the CPU

As the model's terms ask, the app tells the user before the first session that automatic feedback can be wrong and does not replace a qualified teacher.

The optional double-check

Model muhdur's Tilawi FastConformer, offline CTC, int4/int8, 88 MB, CC-BY-4.0
Delivery only if the user turns it on, from the model's own repository: pinned to a commit and SHA-256-verified, with no re-hosting. The app adapts the graph once on the phone (CheckGraph, 3 nodes in front, weights untouched); the result is checked by its SHA-256.
Runtime the same sherpa-onnx, so the APK doesn't grow. It runs in its own process (:doublecheck), because with sherpa-onnx 1.13.8 a second model in the speech engine's process corrupts the engine's state: on a phone, the session went deaf for 20–45 s after each check.
Text the plain-letter Tanzil text published with the model (CC BY 3.0), only to compare what the model writes, never shown

🔉 Changes not directly about memorization

Each has its own commits, so any of them can easily be split out if you prefer.

  • Swap volume keys, under Volume key navigation: an optional setting, off by default, that makes volume up turn to the next page. It is for one-button Bluetooth page turners, which only send volume up. Nothing changes for anyone else. (Allow choosing which page the volume up key turns to)

  • The store app's page types, under the existing Page Type (experimental) setting, which now appears because there is more than one. They use the store app's keys and titles:

    • Madani with tajweed colors;
    • the 1421 and 1440 prints;
    • two line-by-line prints;
    • Shemerly (521 pages).

    The images and glyph boxes come from quran.com's public file server, the same place the Play Store app downloads them from (files.quran.app/hafs/…).

    • Page tables. The 1440 prints and Shemerly have their own page tables, made from the public ayahinfo databases. 25 page starts differ from 1405, and in Shemerly 368 ayat run on to the next page.
    • Line pages. :pages:linebyline draws the line-by-line pages.
    • Picker. The page-type picker has a fixed order and opens on the current type.
    • The default stays the classic Madani mushaf. (Add the Madani mushaf with tajweed colors as a page type, Page editions: …)
  • The reading bookmark toast no longer gets stuck. After moving a reading bookmark, the Undo toast could stay up until Undo was tapped. The reading screen unbinds its presenter when it pauses, which cancelled the toast's timeout but left the toast up. This has been upstream's behavior since 966d521bf.

    • Unbinding now takes the toast down. It goes away after 10 s, or 20 s for the first-time explanation.
    • Every toast has the ✕. (Reading bookmarks: the moved/cleared toast…)
  • Back arrows in Arabic. In Account & Sync and the Download manager, the back arrows pointed forward and the chevrons pointed back in Arabic. QuranIcons.ArrowBack and ChevronRight are built with autoMirror = true, so they already flip in right-to-left layouts, and Modifier.autoMirror() flipped them a second time. The modifier is removed from those icons. (Sync and Download manager: back arrows…)


📦 What changed (click to expand)
Where What
feature/memorize (new) session controller, microphone foreground service, page masks, floating mic, hint voice and its downloads, recordings (store, AAC writer, player, export), settings, model download and import
feature/memorize/tracker (new, pure Kotlin) phoneme tracker (incl. finding where the user started), salah flow, hint scheduler
feature/memorize/engine-sherpa (new) the only module with native code: the speech engine
common/pages GlyphTypeResolver receives each ayah's glyph sizes in the page type in use
common/recitation RecitationPresenter.setReadingScreen(): the pages on screen, and how to start a session there; RecitationStart (the mode window); PagePreviews (mushaf pages drawn outside the reader, for playback)
common/progress (new) the logs on the device (bookmark moves, reading time, session results, progress.db) and the pure logic: cycles, pace, reading time, the reminder's decision
feature/progress (new) the Progress screen (adaptive: rail and panes on tablets), the daily reminder (WorkManager), its settings and the bookmark editor
common/data, common/bookmark five device-only reading bookmark slots (migration 4), each slot's name, purpose and cycle days, backups (ReadingBookmarkType is @JsonClass(generateAdapter = false) so minified builds keep the names backups use)
pages/madani, pages/linebyline (new) the store app's page types, their page tables (1440 prints, Shemerly), line-by-line pages
feature/memorize/check (new) the optional double-check: its model's download and on-phone conversion, the comparison rules, the per-phone advice, and its own process
app, pages word-level glyphs (hide or show single words), the Memorize menu item, recitation slot hooks, hint button in the audio bar, Husary Muallim and Mujawwad reciters, swap volume keys, reading time in the reader, the Progress button on reading bookmark rows, the reading bookmark toast fix. QuranApplication skips its setup in secondary processes (the double-check's).
app/pluggable.gradle plugs :feature:memorize into the existing recitation slot instead of the stubs, and the line-by-line pages
feature/sync, feature/downloadmanager the back arrows and chevrons in Arabic (no double mirroring)
tools/memorize builders for glyph types, pronunciation lexicon and word timings, and the on-device test runner

Changes outside the new modules are additive: existing highlights, selection and audio behave exactly as before.

🧾 The commits, oldest first (click to expand)
Commit What
f15489fb7 Offline Memorize mode and the prayer corrector: the speech engine, tracker, hint scheduler, page masks
27f430a54 Tests with many reciters and readers, following TESTING_STRATEGY.md; the model's license
c6261b769 Continuous sessions across suras, the floating mic, recordings, downloads
d8dbe1e33 Start where the user is (three pages either way), and the floating mic starts a session
259de207f The words are hidden as soon as a session starts
e1ca2b19b Swap volume keys (choose which page volume up turns to)
3d8561d11 Finding the start reliably; cautious hints in salah
be41cbfcd, ba0ea965a Recordings start where the user started; recording tests report a session from its first word
80e2e9e1d Salah: the passage is found when listening starts after Al-Fatiha
b5f425cbc The optional double-check before correcting, recommended per phone
527e79c39 The double-check's model in a process of its own
ee1f27499 Credits for the double-check's model and text; a failed download is shown
5dfce92ad Trace event names that survive R8; session times from the start
b9d3b9f27 A device test for the double-check
5689918cc Reading screens are let go when they close (a 31 MB-per-screen leak)
8d8032a34 A model download that fails for any reason ends as failed
046a33c78 The double-check's audio goes through a file (Android 16 refused large binder messages)
c8c573d7d The Madani mushaf with tajweed colors as a page type
a76d14ee6 Two crashes on the reading screen: the audio's transition key read as a word key (Madani and tajweed pages), and two-page mode starting a page early
75b200026 The reading bookmark toast no longer gets stuck, and has the ✕
94200e919 The store app's page types, their page tables and line-by-line pages; Memorize ayah by ayah on them
49f7b1ea6 Recitation mode, Record and contribute, Recording sessions (playback on the mushaf pages)
10c7dfd84 No ayah is left out; ayat alike no longer pull the session ahead (5:46, 5:44/45, 27:30 fixed on the way)
528289621 Progress (reading cycles, charts, the daily reminder), eight reading bookmarks, tablet layouts
3c49d9c66 Back arrows and chevrons point the right way in Arabic (Account & Sync, Download manager)
964ccb40c Progress: a bookmark not placed yet shows sample days too
2232a1b63 A start dropped after a misheard word is taken up again when the user goes on from it
bb04109f3 Recording sessions on a phone held sideways: the player beside the pages
f34787b47 The backup's reading bookmark names survive minification (the Advanced Options crash Test Lab found)
e119c5589 A model download cut off by the network is tried again
📏 Size, dependencies and permissions
  • APK: +3.6 MB of assets (lexicon, three timing packs, glyph types), plus the native library, +24 MB per ABI (arm64). With per-ABI delivery a phone gets only one of them. The double-check adds nothing to the APK: its model is a download, run by the same library.
  • sherpa-onnx 1.13.8 isn't on Maven Central: tools/memorize/fetch_sherpa_onnx.sh downloads the official AAR and checks its SHA-256, and CI runs it before building.
  • Permissions: RECORD_AUDIO, FOREGROUND_SERVICE_MICROPHONE, POST_NOTIFICATIONS and WAKE_LOCK. REQUEST_IGNORE_BATTERY_OPTIMIZATIONS is used only when the user sets up background listening for salah. Recording needs no other permission. Progress's reminder uses POST_NOTIFICATIONS and the app's WorkManager; no new permission.
⚠️ Known limitations
  • Hafs only. Warsh and Qaloon have other words and ayah numbering, which the model and lexicon don't cover.
  • Memorize goes word by word on the Madani and tajweed pages, and ayah by ayah on the other page types, whose pages have no word boxes.
  • Where two ayat differ only by a letter or a short word, or repeat each other (94:5/6, 102:3/4, 26:121/139), the session can't tell them apart by sound when that letter or word is misheard. It may hold there before you go on.
  • If two reading bookmarks are on the same ayah, an image page underlines it in one color.
  • On the Shemerly pages, a few diacritic marks that reach past their line stay visible around a hidden line.
  • Progress's minutes count time with a page open in the reader. That is not proof of reading, so they pause after 3 minutes without a page turn or touch.
  • Non-native readers, played through a speaker, are the weakest case (32 % above): the model is trained mostly on Arab adults.
  • Very loud or echoing rooms make recognition harder.
  • Spoken hints need the reciter's sura audio downloaded; otherwise the word is only shown.
  • The double-check needs about 300 MB more memory while you recite, so it isn't recommended for phones with less than about 6 GB.

🙏 Credits

  • Quran-Lab for the speech model
  • muhdur for the Tilawi FastConformer (the double-check), built on NVIDIA's FastConformer, and Tanzil for the Quran text
  • quran-transcript for the phonetic script
  • k2-fsa/sherpa-onnx for on-device inference
  • quran.com's public page images and ayahinfo databases, for the page types and their page tables
  • the QUD-Technologies, sobolev210, RetaSy and Quran-Lab datasets, and DEMAND noise, used for testing

👀 Notes for reviewers

This is a big change, and I'm happy to split it:

  • word-level glyphs first, then the feature modules;
  • Progress and the extra reading bookmarks;
  • the page types;
  • the toast fix;
  • the back arrows in Arabic;
  • the volume key setting.

Memorize (احفظ) hides the words of the mushaf page from a chosen ayah and
reveals them as the user recites, entirely on the device: a streaming phoneme
recognizer (sherpa-onnx, Quran-Lab zipformer_p-arabic-v3.1 int8, downloaded
once or imported from files) and a tracker that aligns what is heard with the
expected words. Audio is processed in memory only; nothing is recorded or sent.

The prayer corrector (مصحح الصلاة) marks a wrong word without revealing it
and, when the user is stuck, gives the next word in Husary's voice (Murattal,
Muallim or Mujawwad), one word at a time until they continue. It also follows
a passage hands-free during salah, ignoring Al-Fatiha and the prayer's phrases
and continuing across rak'ahs.

- feature/memorize: session controller, microphone foreground service, page
  masks, hint voice, settings, model download and import
- feature/memorize/tracker: pure Kotlin tracker, salah flow and hint
  scheduler, golden-tested against the reference implementation
- feature/memorize/engine-sherpa: speech engine (sherpa-onnx AAR fetched by
  tools/memorize/fetch_sherpa_onnx.sh) and an on-device benchmark
- app, common: word-level glyphs for madani pages, word hiding, recitation
  slot hooks, audio bar hint button, Husary Muallim and Mujawwad reciters
- tools/memorize: builders for glyph types, lexicon and timing packs, and the
  on-device test runner (Firebase Test Lab or adb)
… the model license

- Add the speech model's license (Quran-Lab No-Profit License 1.2) verbatim as
  feature/memorize/MODEL_LICENSE, and link the model, its mirror and the pinned
  versions from the feature's README.
- Follow TESTING_STRATEGY.md in the session tests: MemorizeSessionController and
  LexiconRepository take their scope, dispatcher and clock through forTest(), and
  the tests run on runTest's virtual time (no sleeps, no runBlocking, Turbine for
  the failure event). The 13 controller tests now take about half a second.
- The on-device session test plays 26 clips in real time: Husary and eight other
  reciters and styles (QUD, CC-BY-4.0), non-professional readers including real
  wording mistakes (sobolev210, MIT) and non-native readers from eight countries
  (RetaSy), reporting what is revealed, mistakes, hints and latency per clip and
  per group.
- Test audio is no longer kept in git: tools/memorize/stage_test_clips.py stages it,
  with the model, into build/memorize-testlab for the test APKs.
@amrfahmyt1983-wq amrfahmyt1983-wq changed the title Add offline Memorize mode and prayer corrector Memorize (احفظ) and Prayer Corrector: offline, private Quran recitation tracking Oct 22, 2026
Feedback from testing on a tablet:

- Sessions go on into the next suras (taraweeh) until the user ends them:
  the next suras are loaded ahead and hidden, and the basmala between
  suras is expected. A session only finishes at the end of the Quran.
- A floating mic shows when the session listens (blue, pulsing), pauses
  and resumes it, ends it, and plays back the recording; it can be dragged
  out of the way.
- Hints: a word gotten wrong again is given at the reciter's next pause;
  after three single words, hints give the rest of the ayah (if no longer
  than the line) or of the line, as the page type in use breaks its lines.
- Every page type is handled the same: glyph types are worked out from the
  page type's own glyph boxes and the text (this reproduces the madani
  types for all 6,236 ayat). Marks are backgrounds under the words, so
  colored mushafs keep their colors.
- Optional recording of the user's recitation (off by default; always or
  ask each time), per sura or per session, kept until deleted or replaced
  by a newer recording of the same place. Played back from the audio bar
  or the mic; My recordings lists, plays, exports (audio, word alignment
  and a NeMo manifest) and deletes them. Recordings stay in no-backup
  storage.
- Automatic downloads (model and hint voice, as needed) and a bulk
  "download for offline use"; the start dialog offers the whole Quran.
- The model can be imported one file at a time, or from its .zip; files
  are recognized by their SHA-256.
- The floating mic is on the reading screen before a session too (green):
  tap to start, long press to choose memorize or salah. It turns blue and
  pulses once listening.
- A session starts where the user starts reciting, anywhere from three
  pages before the page on screen to three after it. Nothing is hidden
  until then, and the page doesn't move. Reciting something that isn't
  there marks the first word on screen (and, while memorizing, gives it
  after the delay); prayer speech and Al-Fatiha in salah aren't marks.
- The reading screen tells the recitation presenter which pages are on
  screen (one, or two side by side).
Before it is known where the user started, every word around the page on
screen is hidden; once found, the words before the start are shown again.
Add a "Swap volume keys" setting under "Volume key navigation" (enabled
only when that is on). Off by default, keeping today's behaviour of
volume up going to the previous page; when on, volume up goes to the
next page and volume down to the previous one. This suits single button
Bluetooth page turners that only send volume up.

The key-to-pager mapping is extracted into VolumeKeyNavigation so it can
be unit tested against the real page/position mapping.
Tested by replaying whole prayers (recordings from mosques) through the
session: in a few pages of Quran, two short words match nearly anything,
Al-Fatiha included, so a session in salah could start at the wrong place
and give hints from there.

- The start is three words in a row heard confidently, more if they are
  short ones; of equally good places, the one nearest the page on screen
  (the Quran repeats some phrases, e.g. Hud 50, 61 and 84). A mistake
  within the first words after it means the start was wrong: it is
  looked for again.
- In salah the passage's start isn't looked for while Al-Fatiha is being
  recited, and a recitation elsewhere is only marked after a few words.
- In salah hints stay one word at a time and stop after three in a row: a
  silence that lasts is more often ruku or sujud than being stuck.
A session may start anywhere around the page on screen: name and split the
recording from the first word the user recited, not from where the session
looked for the start.
The count of phonemes since Al-Fatiha started at Int.MAX_VALUE and wrapped
negative on the first addition, so a session started after Al-Fatiha
(e.g. once the imam had finished it) never looked for the passage: it
stayed in the Al-Fatiha phase for good. It now saturates.

Also adds an opt-in diagnostics trace (adb shell setprop
log.tag.MemorizeTrace DEBUG): what the session heard, the start search,
salah phases, events and hint decisions, which found this.
…phone

Before a hint is spoken, and a second after a mistake before its mark is
shown, a larger model (muhdur's Tilawi FastConformer, CC-BY-4.0) listens
again to the last 8 seconds the user said. If the word was said after
all, nothing is corrected; a dropped hint counts the word as recited. In
the lab: false hints in mosque prayers -28 % (-43 % while reciting), tlog
clips with false marks -57 %, recall unchanged, 0 of 400 real stalls
wrongly dropped.

- Off by default; a 92 MB download from the model's own repository,
  pinned and checksummed. It runs on the sherpa-onnx already in the app
  (as a raw-audio CTC model), so the APK doesn't grow: CheckGraph adapts
  the graph once on the phone (3 nodes in front, weights untouched),
  byte-identical to the lab's onnx conversion and checked by SHA-256.
  The model store can now convert a verified download (or import).
- The comparison rules (CheckText) are ported from the lab and
  reproduce its tables for all 1,025 pieces and 77,433 words, from the
  Tanzil text published with the model and the app's lexicon.
- DoubleCheckAdvice recommends it on phones with ~6 GB of memory or more
  and a 64-bit processor, then by the time a check takes on the phone
  (not above 1.5 s). The setting says whether and why; where it suits,
  it is also offered with the first model download and in Download for
  offline use.
- The check runs on its own thread, never hears the hints, and is
  released with the session. Settings and dialogs in English and Arabic.
With sherpa-onnx 1.13.8, a second model decoding in the speech engine's
process corrupts the engine's state. On a Mi 11, the session went deaf for
20-45 s after a check, until its stream started over: a whole prayer
followed 135-289 words instead of 586. This happened whether or not the two
models decoded at the same time, and with or without a lock. On a desktop,
the two failed outright when they did.

The model now runs in DoubleCheckService (":doublecheck"), reached over a
Messenger. If that process goes away, the checks hear nothing and the
session corrects as it would without them. The app skips its own setup in
secondary processes.
On a device, as the app runs it: the model is downloaded as published and
converted there, it is loaded in its own process, it finds words of
Al-Husary's Al-Mulk 1-5 in the last seconds (not a word from another
sura), and the speech engine hears exactly the same with checks running
next to it as without. Also passes the session test its (absent)
double-check.
The memorize presenter kept the reading screen's callbacks after the
screen closed. The presenter itself outlives the screen, because the audio
bar's collectors (never cancelled, an existing leak) keep it. So every
reading screen opened was kept whole, with its page images: 31 MB each,
found with LeakCanary. Over a morning of sessions on a Mi 11, the release
build grew to 1.4 GB. The presenter now drops what the screen gave it when
the screen closes.
…process important

Each check sent 8 s of audio to the check's process in a one-way binder
message, and a Bundle stores each short as 4 bytes: 512 KB a message. On
Android 16 (Test Lab, 16 KB pages), those were refused ("FAILED BINDER
TRANSACTION ... No space left on device"), with the process seen as
frozen, so every check silently came back "not said". The audio now goes
through a file in the app's cache, and the binding is BIND_IMPORTANT so
the process runs at the app's priority while a session uses it. The device
test passes on Android 14 and 16 (5 of 5 words found, the other sura's
word not, 0.3 s a check, the speech engine unchanged).
The colored pages quran.com's own app offers under Page Type
(experimental), from the same public server it downloads them from
(files.quran.app/hafs/tajweed: one width, 1280 px, with its own glyph
boxes). The same pages, ayat and reciters as the Madani page type. With a
second page type, the existing Page Type (experimental) setting appears.

Memorize works on it as on any page type: its words are told apart at
runtime from this layout's own glyph boxes (6,232 of 6,236 ayat; the 4
whose end marker isn't a glyph of its own are hidden ayah by ayah), and its
marks are drawn under the words, so the colors stay.
Brings in the 99 commits of quran/quran_android main up to c94ebe1
(page themes and the app theme, night mode that keeps tajweed hues,
Account & Sync, bookmark page-type mapping, dependency updates).

Conflicts resolved:
- settings.gradle.kts, gradle/libs.versions.toml: both sides kept (the
  memorize modules next to :feature:pagetheme; sherpa-onnx and the test
  runner next to the new AGP version).
- QuranApplication: both imports kept (secondary-process check and the
  direct-boot WorkManager check).
- PagerActivity: the night-mode menu item is gone upstream; only the
  memorize menu item is kept there.
- strings.xml (en, ar): both sides' strings kept.

The tajweed page type inherits the Madani mushaf type for bookmark
sync through its delegation to MadaniPageProvider.
- Recitation audio moving to the next ayah: its animated highlight's key
  ("2:5->2:6") was taken for a word key on pages whose word glyphs are
  derived (Madani and Tajweed here), and parsing it threw in onDraw.
  Transitions now keep the bounds they always had.
- Two pages on screen: the current page is the first of the pair, not the
  second, so the session started a page early, and with nothing selected
  on the first pair it looked up page 0 and crashed. The last pair of a
  mushaf with an odd number of pages has one page.
…can be closed

The reading screen unbinds the presenter when it pauses (screen off,
recents, another screen), and unbinding cancelled the toast's timeout
but left the toast up, so it stayed until Undo. Unbinding now takes it
down. It goes away after 10 seconds (20 for the first-time explanation),
and its x, which only the first-time toast had, is on every toast to
close it at once. The timeout runs on the presenter's main scope.
All seven page types of quran.com 3.6.5, from files.quran.app/hafs, under
the store app's keys: new_madani (1421), new_madani_1441 (1440),
new_madani_1439_lines, madani_1441_lines and shemerly (521 pages), next to
madani and tajweed. Titles in English and Arabic come from the store app.

- Providers: pages/madani's provider/edition (HafsEditionPageProvider);
  TajweedPageProvider moves onto it (version 7).
- Page tables made from the public ayahinfo databases:
  Madani1440DataSource for the four newer prints (25 page starts differ
  from 1405) and ShemerlyDataSource (368 ayat run on to the next page;
  the derived table fixes 4 errors in the store's).
- Line-by-line pages: the new :pages:linebyline provides the
  PageViewFactoryProvider (open-source build only, app/pluggable.gradle).
- Memorize works ayah by ayah where a page has no word boxes: word keys
  take their ayah's bounds, line pages hide ranges by clipping the line
  images, and an ayah that runs on to the next page is marked on both
  (Shemerly). PageLines follows page-type switches.
- The page-type picker has a fixed order and opens on the current type.
- The mode window: tapping a mic (floating, the audio bar's, "Recite from
  here") opens a sheet, Memorization or Recitation (a long press adds
  salah); RecitationStart replaces showModeSelection. The toolbar's
  Memorize starts right away.
- Recitation (Mode.RECITE) hides nothing: a trail on the words read, hinted
  words marked, and with "mark mistakes" on, skipped words and the mistake
  being made; "say the correct word" follows a mistake after the hint
  delay. Both are switches in Settings. At night an underlay colour with
  its own alpha keeps it.
- Record and contribute (a switch with a one-time explanation): every
  session is recorded, and its recordings keep what the speech model heard
  and what the app decided (<id>.heard.jsonl). Nothing is sent. Recording
  format 2 (per-word mistake counts, contribute); version 1 still reads.
  Word times no longer drift after the recorder drops audio (AudioClock).
- Recording sessions (Settings; was "My recordings"): sessions by day,
  swipe to delete with Undo, export, and playback on the session's own
  mushaf pages (PagePreviews in common/recitation, AppPagePreviews in the
  app): the page turns with the word heard, marks shown from the start,
  tap a word to play from it, a legend, 5 s back and on.
- MemorizeScreensRenderTest (-Pmemorize.render) draws the feature's screens
  to PNG; README sections for all of the above.
…ssion ahead

- The tracker knows which ayah each word is in. In Memorization and
  Recitation a user who goes on to a later ayah without reciting one is
  held at its first word, which is marked and given after the hint delay
  until they are back. After ten hints (or when no hint will give the
  word) they are followed on and the words left out are marked as
  skipped. Speech where the words should be (misheard) lets them pass;
  only words with nothing heard count as left out. Salah keeps following
  the reciter.
- Settings, "Words missed inside a verse": "Let a word or two pass"
  (default; never more than half an ayah) or "Every word must be heard".
- No hint while the start waits on ayat that open alike (2:149/150).
- A phrase an ayah says twice (5:46) isn't taken for a repetition: behind
  the cursor a path starts within backWords, at the ayah's start, or where
  a repetition goes on. At the 458 nearby look-alike pairs: correct
  passages clean 133 -> 139, restarts 281 -> 288, QUD recall with every
  word to be heard 52 % -> 86 %.
- A phrase the ayah before also has (5:44/45) isn't taken for going back
  to it.
- 27:30's basmala is the ayah's words, not the phrase before a sura.
- A start dropped after a misheard word stays where the user was expected,
  instead of the first ayah on screen (live on the Mi 11: 5 of 6 places
  that had lost the reciter now pass).
- Test clips are labelled with the ayah they recite (skeleton()'s
  diacritics range had been reversed, so every text matched ayah 1).
- Real fixtures pin each case.
…bookmarks; tablet layouts

- :common:progress keeps on the device (progress.db): every reading
  bookmark move, time with a Quran page open in the reader (paused after 3
  minutes without a page turn or touch, credited to the bookmark moved at
  the end of that reading), and each Memorize session's results (passage,
  mode, date, length, counts per ayah; no audio, no heard words). A
  setting turns the session log off and clears it.
- A reading cycle starts on its own when a bookmark goes from the last
  suras back to Al-Fatiha (an Undo within 60 s cancels it); pace, pages
  needed per day and the projected finish come from QuranInfo, so every
  page edition counts right.
- :feature:progress: the Progress screen (main menu, and a chart button on
  reading bookmark rows). Per bookmark: pages and minutes per day, the
  current cycle on a juz line, total reading and the last cycle. Also
  Memorizing (share of ayat held per juz and sura), Salah and Sessions
  (recorded ones open in Recording sessions). Rail and two panes on
  tablets (MatePad 12 X), one pane at a time on phones; English and
  Arabic, day and night.
- A daily reminder (WorkManager, 20:00 by default) to finish the cycle in
  its days; quiet when the reader is open or today's pages are read.
- Reading bookmarks: five more colours kept on the device (green, blue,
  purple, brown, grey), each with a name, a purpose (reading,
  memorization, review) and cycle days, set in Settings. They work like
  teal, orange and red: the ayah menu, underlines, the Bookmarks list,
  backups (BookmarkData.localReadingBookmarks; old backups still restore).
- Memorize on tablets: the mode window's modes as cards, Recording
  sessions with the list and the session side by side, and a session
  timeline beside the player.
- Tests: the cycle, pace, reading time, recorder and reminder logic;
  bookmark routing and migration 4; ProgressScreenRenderTest
  (-Pprogress.render) and an on-device screenshot test.
…ay in Arabic

QuranIcons.ArrowBack and ChevronRight are built with autoMirror = true, so
they already flip in right-to-left layouts. Modifier.autoMirror() flipped
them a second time, and in Arabic the back arrow pointed forward and the
chevrons pointed back. The modifier is gone from the four back arrows
(Account & Sync, Sync activity, Quran sync, Download manager) and the
three chevrons.
On a fresh install nothing is placed, so every bookmark only said "Place
this bookmark...", and Progress showed no chart at all, on a tablet's
three panes as on a phone. A bookmark not placed yet now shows the same
faded sample days, with the "Sample data" label, as one placed but not
moved yet. The sentence line is left out when there is nothing to say.
Render test: a bookmark not placed yet.
…n the user goes on from it

Live on the Mi 11 (Husary's 102:1-3 then 102:5, leaving 102:4 out): the
start was found on 102:1-2, then زرتم was misheard and the start dropped.
كلا and سوف were misheard too, so the search never heard three clear words
in a row again, marked "recited elsewhere" and lost the reciter.

The place where a start was dropped is kept. One clear word there or right
after it (4 phonemes or more) takes it up again: the word before it was
said (misheard), unless nothing was heard there, and the session goes on
after it. Found twice at the same place, the start is no longer doubted: a
word misheard after it is an ordinary mistake, which the following words
recover, and an ayah left out is held at. A new start elsewhere still
needs a run of words.

Fixtures (RecitationTrackerLiveStartTest), the phone's streams: 102:1-3
then 102:5 (before: only 102:1-2 followed; now 102:3 too, and the session
holds at 102:4:1), and 102:1-5 said correctly (followed to its end).
Replayed on all 178 Memorize and Recitation sessions the Mi 11 heard, 12
change: false "recited elsewhere" marks go, and 102:3-4 is followed where
the old search jumped ahead to 102:5. A clear word two on was tried and
left out: in 102:1-5 said correctly it took the start up again where the
old search waited, and the session then held at 102:4:1, which differs
from 102:3 by one word.
…e pages

On a short screen (a phone in landscape, under 480dp tall) the session
window gave the mushaf page a strip about 150dp high above the legend and
the player. There the pages now take the height, with the legend and the
player in a column beside them (mirrored in Arabic); taller screens keep
the player under the pages.

The render tests also draw a phone on its side, a small phone (360x640dp)
and, for Progress, a small tablet (715dp, as the Galaxy Tab A7 Lite);
Progress's render test gets a 2 GB heap for its tablet-sized bitmaps.
Test Lab's Robo crawl of the minified tablet build crashed opening
Settings > Advanced settings: building the bookmark backup's JSON adapter,
Moshi looks ReadingBookmarkType's constants up by name, and R8 had renamed
them (TEAL -> m), so it threw "AssertionError: Missing field". Marked
@JsonClass(generateAdapter = false), the enum keeps its constants' names
under Moshi's own R8 rules.
On Test Lab's Galaxy A05s (a budget phone) the double-check's 92 MB model
download broke off ("unexpected end of stream"), and a download had no
second try: the user had to start it again. Now a file whose connection
drops, comes short, or meets a server error is fetched again, three times
in all (after 2 s, then 4 s). A file that isn't the one pinned, or a
missing one (HTTP 4xx), still fails at once. Both the speech model and the
double-check use it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant