MasterFlasher
MasterFlasher is an Android app that converts shared text, URLs, local PDF files, or voice input into AnkiDroid flashcards using Gemini.
Content shared from any app is silently saved to an inbox. Users later extract readable text (for URLs and PDFs), generate flashcards, review them, and add selected cards to AnkiDroid.
Installation
Download the latest APK from the GitHub Releases page:
- Go to the latest release
- Download the
.apkfile under Assets - Open the APK on your Android device to install
- Enable Install from unknown sources if prompted
Note: This app requires AnkiDroid to be installed on the device.
How MasterFlasher Works
This section defines the complete end-to-end behavior of the app.
-
Input
- Content enters the app via Android Share (text, URL, PDF) or via in-app voice dictation.
- Share actions are silent: the UI does not open.
-
Inbox Persistence
- Each input is stored as an inbox entry in a local Room-backed SQLite database.
- A toast confirms successful save.
-
Content Extraction
- URLs: Opens an in-app browser; when the user taps Extract to Anki, injected JavaScript (Readability) extracts the page’s readable article text.
- PDFs: Users share a local PDF file (e.g., from a file manager) to MasterFlasher; the file reference is saved to the inbox and text is extracted on demand using pdf.js.
- Plain text and voice input require no extraction.
-
Card Generation
- Extracted text is sent to Gemini for flashcard generation.
- Gemini responses are required to be strict JSON.
- Users may configure a custom deck name per entry.
-
Review & Commit
- Cards are reviewed individually.
- Accepted cards are inserted into AnkiDroid.
- Decks and note models are created automatically if they do not exist.
-
Lifecycle Cleanup
- Once all generated cards are added, the inbox entry is automatically deleted.
Capabilities
Inputs
- Android Share: text, URLs, PDFs
- In-app voice dictation
- Camera OCR: Connects to device camera to capture and extract text from physical documents
Extraction
- Readability-based article extraction for URLs
- pdf.js text extraction for PDFs
AI
- Gemini-powered fact extraction and flashcard generation
- User-editable prompts
- Strict JSON schema validation
AnkiDroid Integration
- Deck creation
- Note model creation (
com.snortstudios.masterflasher) - Direct note insertion
UX
- Silent share handling
- Inbox-based deferred processing
- Manual per-card review
- Automatic entry cleanup
UI Notes
- Inbox supports pull-to-refresh.
- Swipe left on an entry to delete it.
- Entries with generated cards display a lock icon and Cards Ready badge.
Voice Input UI
- Tap the microphone button (🎤) to dictate text.
- Speech is transcribed live.
- Users may edit the transcription before saving it to the inbox.
Camera OCR UI
- Tap the camera button (📷) to capture text from physical documents.
- A live camera preview opens; capture a photo of the text you want to extract.
- Crop the image to isolate the specific paragraph or text block.
- On-device ML Kit extracts text from the cropped image.
- Review and edit the extracted text before saving to the inbox.
- Android only: This feature is not available on web or iOS builds.
User-Editable Prompts
MasterFlasher allows users to customize the prompts sent to Gemini for fact extraction and flashcard generation without modifying app code.
Bring Your Own Key (BYOK)
MasterFlasher operates on a Bring Your Own Key (BYOK) model.
- Users supply their own Gemini API key.
- No API keys are bundled with the app.
- All AI requests are made directly from the device using the user’s key.
- Each card generation involves multiple Gemini API calls as part of a quality-focused pipeline.
This ensures:
- User ownership of API usage and quotas
- No shared keys
- No server-side proxying
API Key Storage & Security
- API keys are stored only on the device.
- Keys are encrypted and persisted using Android KeyStore–backed secure storage (capacitor-secure-storage-plugin).
- Keys are never logged, transmitted to third-party servers, or stored in plaintext.
Project Structure
-
src/pages/InboxScreen.tsx
Main inbox screen and voice input FAB -
src/pages/EntryDetailScreen.tsx
Content extraction, card generation, and review UI -
src/pages/SettingsScreen.tsx
API key and model configuration -
src/plugins/Inbox.ts
Inbox database plugin interface -
src/plugins/SpeechRecognition.ts
Native speech recognition wrapper -
src/hooks/useSpeechRecognition.ts
Speech recognition hook -
src/hooks/useCameraOCR.ts
Camera OCR hook -
src/plugins/CameraOCR.ts
Camera OCR plugin interface -
src/lib/gemini/
Gemini prompts, schemas, and response parsing -
android/app/src/main/java/com/snortstudios/masterflasher/db/
Room entities and DAOs -
android/app/src/main/java/com/snortstudios/masterflasher/plugins
Native Capacitor plugins
Build Requirements
- Node.js + npm
- Android Studio (for emulator or device builds)
- AnkiDroid installed on the target device
- Gemini API key
Setup (Development)
-
Install dependencies
-
Configure environment (Development only) Create a
.envfile in the repository root:VITE_GEMINI_API_KEY=your_gemini_api_key_here VITE_GEMINI_MODEL_NAME=gemini-2.5-flash-lite
Note: In production, users configure their own API key via the Settings screen. The
.envfile is only needed for development. -
Sync Capacitor
-
Run on Android
Or open Android Studio:
Configuration Notes
- Default deck name is
MasterFlasher(customizable per entry). - Model key used for cards is
com.snortstudios.masterflasher. - Gemini output is expected to be strict JSON; failures will surface in the UI log.
- Default Gemini model is
gemini-2.5-flash-litewhen not specified. - Generated cards and entries are stored in a local SQLite database.
Gemini Generation Pipeline
Each card generation uses multiple Gemini API calls:
-
Fact Extraction
The source text is analyzed to produce a list of candidate atomic facts. -
Fact Scoring & Filtering
The fact list is scored for usefulness and relevance; low-quality or redundant facts are filtered out. -
Flashcard Generation
The remaining facts are converted into question–answer flashcards.
API Key Configuration
Development Mode
Uses .env file variables (VITE_GEMINI_API_KEY, VITE_GEMINI_MODEL_NAME).
Production Mode
Users configure their own Gemini API key via the in-app Settings screen:
- Tap the settings icon (⚙️) in the header
- Enter your Gemini API key (get one free from Google AI Studio)
- Optionally specify a different Gemini model
- Tap "Save Settings"
API keys are stored securely using platform-native encryption (Android KeyStore).
Troubleshooting
- "Gemini API Key not configured": In production, open Settings to enter your API key. In development, check
.envand restart the dev server/build. - "AnkiDroid not available": ensure AnkiDroid is installed and the API is enabled.
- Share does nothing: confirm the app is installed and chosen as a share target.
License
This project is licensed under the
Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).
- ✅ Free to use, modify, and share for non-commercial purposes
- ❌ Commercial use is not permitted without permission
See the LICENSE file for details.



