StudyApp & ation

Comprehensive Study Companion
Back to Gateway

1. Comprehensive Overview

1.1 What the App Does

StudyApp is a native Android application built with Kotlin and Jetpack Compose. Its primary purpose is to act as an intelligent study assistant. It helps students and learners process study materials, understand complex topics, and test their knowledge. The app allows users to upload various document types (PDFs, Word documents, PowerPoint presentations, Excel sheets, and plain text files), extracts the text, and leverages AI to generate comprehensive explanations, summaries, and interactive multiple-choice quizzes. It also tracks the user's study sessions and provides a dashboard with study statistics and analytics.

1.2 The Purpose

The core mission of StudyApp is to transform passive reading into active learning. By breaking down large documents into manageable chunks and providing expert tutor-level explanations, it makes learning more accessible. The interactive quizzes help solidify knowledge. The built-in timer and analytics dashboard encourage consistent study habits by gamifying the learning experience with streaks and time tracking.

1.3 System Architecture (How it Works)

The app follows a modern Android architecture based on Model-View-ViewModel (MVVM) principles and unidirectional data flow.

---

2. Network API Requests and AI Integration

The core intelligence of the app relies on communicating with the Groq API. All network logic is centralized in the OnlineAIManager.kt and GroqApiService.kt files.

2.1 The Setup

2.2 Document Chunking and Rate Limiting

Before making requests, large documents are processed to prevent exceeding the model's token context window.

2.3 Prompts and Explanations (`generateSummaryStream`)

When a user asks to "Explain" a document, the app acts as an expert tutor.

1. Detailed Overview

2. Core Concepts Explained

3. Practical Examples

2.4 Generating Quizzes (`generateQuizStream`)

When a user requests a quiz, they select the desired number of questions (e.g., 15, 30, 50). The app dynamically divides this request across the document chunks.

2.5 Title Generation (`generateTitle`)

A smaller, faster request is made simply to generate a concise title (max 5 words) based on the first 2000 characters of an uploaded document.

---

3. Detailed File-by-File Analysis

3.1 Data Layer

app/src/main/java/com/example/studyapp/data/local/StudyDatabase.kt

app/src/main/java/com/example/studyapp/data/local/StudySessionDao.kt

app/src/main/java/com/example/studyapp/data/local/HistoryDao.kt

app/src/main/java/com/example/studyapp/data/local/QuizModels.kt

app/src/main/java/com/example/studyapp/data/repository/StudyRepository.kt

3.2 Network and AI Layer

app/src/main/java/com/example/studyapp/network/GroqApiService.kt

app/src/main/java/com/example/studyapp/ai/OnlineAIManager.kt

3.3 UI Layer (Jetpack Compose)

app/src/main/java/com/example/studyapp/MainActivity.kt

app/src/main/java/com/example/studyapp/ui/study/StudyViewModel.kt

app/src/main/java/com/example/studyapp/ui/study/StudyScreen.kt

app/src/main/java/com/example/studyapp/ui/study/DashboardScreen.kt

app/src/main/java/com/example/studyapp/ui/study/QuizUI.kt

app/src/main/java/com/example/studyapp/ui/study/DynamicWaveLoader.kt

app/src/main/java/com/example/studyapp/ui/study/RichTextView.kt & app/src/main/java/com/example/studyapp/ui/study/HtmlWebView.kt

3.4 Utility Layer

app/src/main/java/com/example/studyapp/utils/DocumentParser.kt

build.gradle.kts (App Level)

---

*End of Document*