An Android flashcard app with spaced repetition (SM-2 algorithm) for efficient long-term memorization.
- 📇 Multiple decks — organize cards by subject (languages, biology, programming, etc.)
- 🧠 SM-2 spaced repetition algorithm — the same algorithm used by Anki, schedules each card for review at optimal intervals based on user performance
- 📊 Statistics dashboard — track day streak, retention rate, total reviews, and a 7-day activity chart
- 🎨 Material Design 3 — modern, clean UI with proper theming and accessibility support
- 💾 Offline-first — all data stored locally in SQLite, no internet required
- 🚀 Lightweight — small APK size, no third-party charting libraries (custom
BarChartView)
| Home | Study Session | Statistics |
|---|---|---|
![]() |
![]() |
![]() |
The project follows a clean, layered architecture:
app/src/main/java/com/example/studybuddy/
├── MainActivity.java ← decks list (entry point)
├── DeckActivity.java ← cards inside a deck
├── StudyActivity.java ← study session with SRS grading
├── AddCardActivity.java ← create / edit card form
├── StatsActivity.java ← statistics dashboard
├── model/ ← POJOs: Deck, Card, ReviewLog
├── database/ ← SQLiteOpenHelper + Repository pattern
├── adapter/ ← RecyclerView adapters
└── util/
├── SpacedRepetition.java ← SM-2 algorithm implementation
└── BarChartView.java ← custom View for the 7-day chart
- Repository pattern: Activities never touch the database directly — all SQL is centralized in
StudyRepository.java - Foreign keys with
ON DELETE CASCADE: deleting a deck automatically removes its cards and review logs - Custom chart view: no MPAndroidChart or similar dependency, keeping the APK small
Each card stores SRS state (easeFactor, intervalDays, repetitions, dueDate). When the user grades a card:
| Grade | Effect |
|---|---|
| Again (forgot) | Reset progress, decrease ease, show again in 10 min |
| Hard | Normal interval × 0.8 |
| Good | Normal interval × ease factor |
| Easy | Normal interval × 1.3, increase ease factor |
The interval grows exponentially for correctly remembered cards (1 day → 6 days → ~15 days → ~37 days...), so well-known cards appear rarely while forgotten ones come back quickly.
- Android Studio Hedgehog (2023.1.1) or newer
- JDK 17
- Android SDK 34
- Clone the repository:
git clone https://github.com/giovergos/study-buddy.git
- Open the project in Android Studio (
File → Open→ select theStudyBuddyfolder) - Wait for Gradle sync to complete
- Build APK:
Build → Generate App Bundles or APKs → Generate APKs - The APK will be at
app/build/outputs/apk/debug/app-debug.apk
Three tables with proper foreign key relationships:
decks (_id, name, description, created_at)
cards (_id, deck_id, front, back, ease_factor, interval_days,
repetitions, due_date, created_at)
review_logs (_id, card_id, quality, reviewed_at)- Language: Java 8
- UI: AndroidX AppCompat, Material Components 1.11
- Persistence: SQLite via
SQLiteOpenHelper - Architecture: Repository pattern, no external frameworks
- Min API: 24 (Android 7.0)
MIT License — feel free to use this code for learning or your own projects.
Built as a university assignment to demonstrate Android development fundamentals: multiple Activities, persistent storage, Material Design, clean code practices, and a touch of algorithmic substance via the SM-2 implementation.


