diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e4bb2d8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+QuizApp/app/google-services.json
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/Android-Quiz-App.iml b/.idea/Android-Quiz-App.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/Android-Quiz-App.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml
new file mode 100644
index 0000000..2697e35
--- /dev/null
+++ b/.idea/caches/deviceStreaming.xml
@@ -0,0 +1,909 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deviceManager.xml b/.idea/deviceManager.xml
new file mode 100644
index 0000000..91f9558
--- /dev/null
+++ b/.idea/deviceManager.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..4ead668
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..8528de5
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QuizApp/.idea/AndroidProjectSystem.xml b/QuizApp/.idea/AndroidProjectSystem.xml
new file mode 100644
index 0000000..4a53bee
--- /dev/null
+++ b/QuizApp/.idea/AndroidProjectSystem.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QuizApp/.idea/copilot.data.migration.agent.xml b/QuizApp/.idea/copilot.data.migration.agent.xml
new file mode 100644
index 0000000..4ea72a9
--- /dev/null
+++ b/QuizApp/.idea/copilot.data.migration.agent.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QuizApp/.idea/copilot.data.migration.ask.xml b/QuizApp/.idea/copilot.data.migration.ask.xml
new file mode 100644
index 0000000..7ef04e2
--- /dev/null
+++ b/QuizApp/.idea/copilot.data.migration.ask.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QuizApp/.idea/copilot.data.migration.ask2agent.xml b/QuizApp/.idea/copilot.data.migration.ask2agent.xml
new file mode 100644
index 0000000..1f2ea11
--- /dev/null
+++ b/QuizApp/.idea/copilot.data.migration.ask2agent.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QuizApp/.idea/copilot.data.migration.edit.xml b/QuizApp/.idea/copilot.data.migration.edit.xml
new file mode 100644
index 0000000..8648f94
--- /dev/null
+++ b/QuizApp/.idea/copilot.data.migration.edit.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QuizApp/.idea/deviceManager.xml b/QuizApp/.idea/deviceManager.xml
new file mode 100644
index 0000000..91f9558
--- /dev/null
+++ b/QuizApp/.idea/deviceManager.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QuizApp/.idea/inspectionProfiles/Project_Default.xml b/QuizApp/.idea/inspectionProfiles/Project_Default.xml
index cde3e19..7061a0d 100644
--- a/QuizApp/.idea/inspectionProfiles/Project_Default.xml
+++ b/QuizApp/.idea/inspectionProfiles/Project_Default.xml
@@ -49,6 +49,10 @@
+
+
+
+
diff --git a/QuizApp/.idea/misc.xml b/QuizApp/.idea/misc.xml
index 74dd639..b2c751a 100644
--- a/QuizApp/.idea/misc.xml
+++ b/QuizApp/.idea/misc.xml
@@ -1,4 +1,3 @@
-
diff --git a/QuizApp/.idea/vcs.xml b/QuizApp/.idea/vcs.xml
index 94a25f7..288b36b 100644
--- a/QuizApp/.idea/vcs.xml
+++ b/QuizApp/.idea/vcs.xml
@@ -1,6 +1,7 @@
+
\ No newline at end of file
diff --git a/QuizApp/README.md b/QuizApp/README.md
deleted file mode 100644
index e3785cf..0000000
--- a/QuizApp/README.md
+++ /dev/null
@@ -1,302 +0,0 @@
-# Quiz App ๐
-
-A modern Android quiz application built with Kotlin and Jetpack Compose that provides an interactive quiz experience with multiple-choice questions and navigation between different screens.
-
-## ๐ฑ Features
-
-- Interactive quiz interface with multiple-choice questions
-- Modern Material Design 3 UI
-- Navigation between different quiz screens
-- Score tracking and results display
-- Clean and intuitive user experience
-- Built with latest Android development technologies
-
-## ๐ ๏ธ Tech Stack
-
-- **Language**: Kotlin
-- **UI Framework**: Jetpack Compose
-- **Architecture**: Modern Android Architecture
-- **Navigation**: Navigation Compose
-- **Design System**: Material Design 3
-- **Min SDK**: 24 (Android 7.0)
-- **Target SDK**: 34
-- **Compile SDK**: 35
-
-## ๐ Prerequisites
-
-Before running this application, make sure you have:
-
-- Android Studio (Latest version recommended)
-- JDK 11 or higher
-- An Android device or emulator with API level 24+
-- Gradle 8.0+
-
-## ๐ Installation & Setup
-
-### 1. Clone the Repository
-```bash
-git clone https://github.com/Shivamtawar/QuizApp.git
-cd QuizApp
-```
-
-### 2. Open in Android Studio
-1. Launch Android Studio
-2. Select "Open an existing project"
-3. Navigate to the cloned repository folder
-4. Select the project and click "Open"
-
-### 3. Sync Dependencies
-1. Wait for Android Studio to automatically sync Gradle files
-2. If sync doesn't start automatically, click "Sync Now" in the notification bar
-
-### 4. Build and Run
-1. Connect your Android device or start an emulator
-2. Click the "Run" button (green play icon) in Android Studio
-3. Select your target device
-4. Wait for the app to build and install
-
-## ๐๏ธ Project Structure
-
-```
-app/
-โโโ src/
-โ โโโ main/
-โ โ โโโ java/com/example/quizappminiproject/
-โ โ โ โโโ MainActivity.kt # Main activity
-โ โ โ โโโ QuizScreen.kt # Quiz interface composables
-โ โ โ โโโ QuestionData.kt # Data models for questions
-โ โ โ โโโ ResultScreen.kt # Results display screen
-โ โ โ โโโ Navigation.kt # Navigation setup
-โ โ โ โโโ ui/theme/ # App theme and styling
-โ โ โโโ res/
-โ โ โ โโโ values/ # App resources
-โ โ โ โโโ drawable/ # App icons and images
-โ โ โโโ AndroidManifest.xml
-โ โโโ androidTest/ # Instrumented tests
-โ โโโ test/ # Unit tests
-โโโ build.gradle.kts # App-level Gradle build file
-โโโ proguard-rules.pro # ProGuard configuration
-```
-
-## ๐ฎ App Flow
-
-### 1. Start Screen
-- Welcome screen with app branding
-- Start quiz button to begin the quiz
-
-### 2. Quiz Interface
-- Multiple-choice questions display
-- Question navigation (Next/Previous)
-- Progress indicator
-- Timer functionality (if implemented)
-
-### 3. Results Screen
-- Final score display
-- Performance feedback
-- Option to restart quiz
-- Share results functionality
-
-## ๐ง Key Dependencies
-
-The app uses the following main dependencies:
-
-```kotlin
-// Core Android libraries
-implementation("androidx.core:core-ktx")
-implementation("androidx.lifecycle:lifecycle-runtime-ktx")
-implementation("androidx.activity:activity-compose")
-
-// Jetpack Compose
-implementation("androidx.compose.ui:ui")
-implementation("androidx.compose.ui:ui-graphics")
-implementation("androidx.compose.ui:ui-tooling-preview")
-implementation("androidx.compose.material3:material3")
-
-// Navigation
-implementation("androidx.navigation:navigation-compose:2.7.5")
-
-// Testing
-testImplementation("junit:junit")
-androidTestImplementation("androidx.test.ext:junit")
-androidTestImplementation("androidx.test.espresso:espresso-core")
-```
-
-## ๐ Quiz Data Structure
-
-### Question Model
-```kotlin
-data class Question(
- val id: Int,
- val question: String,
- val options: List,
- val correctAnswer: Int,
- val explanation: String? = null
-)
-```
-
-### Quiz Categories
-- General Knowledge
-- Science & Technology
-- History
-- Geography
-- Sports
-- Entertainment
-
-## ๐จ App Components
-
-### MainActivity
-- Entry point of the application
-- Sets up the navigation and theme
-
-### QuizScreen
-- Main quiz interface
-- Handles question display and user interactions
-- Manages quiz state and progress
-
-### ResultScreen
-- Displays quiz results and score
-- Provides feedback based on performance
-- Options for retaking quiz
-
-### Navigation
-- Handles screen transitions
-- Manages app navigation state
-- Deep linking support
-
-## ๐ง Configuration
-
-### Customization Options
-- **Quiz Duration**: Modify timer settings
-- **Question Count**: Adjust number of questions per quiz
-- **Difficulty Levels**: Easy, Medium, Hard
-- **Categories**: Add or modify quiz categories
-
-### Theme Customization
-The app supports Material Design 3 theming:
-- Dynamic color support (Android 12+)
-- Light and dark theme variants
-- Custom color schemes
-
-## ๐งช Testing
-
-### Running Tests
-```bash
-# Run unit tests
-./gradlew test
-
-# Run instrumented tests
-./gradlew connectedAndroidTest
-
-# Run all tests
-./gradlew check
-```
-
-### Test Coverage
-- Unit tests for quiz logic
-- UI tests for user interactions
-- Integration tests for navigation
-
-## ๐ฑ Supported Android Versions
-
-- **Minimum SDK**: 24 (Android 7.0 Nougat)
-- **Target SDK**: 34 (Android 14)
-- **Recommended**: Android 8.0+ for best experience
-
-## ๐ฆ Error Handling
-
-The app includes comprehensive error handling for:
-- Network connectivity issues (if applicable)
-- Invalid quiz data
-- Navigation errors
-- State management issues
-
-## ๐ State Management
-
-- Uses Compose state management
-- ViewModel pattern for business logic
-- StateFlow for reactive data streams
-- Remember and rememberSaveable for UI state
-
-## ๐ฏ Performance Optimization
-
-- Lazy loading of quiz questions
-- Efficient Compose recomposition
-- Memory leak prevention
-- Optimized navigation transitions
-
-## ๐ Troubleshooting
-
-### Common Issues
-
-1. **Build failures**
- - Clean and rebuild: `./gradlew clean build`
- - Invalidate caches: File โ Invalidate Caches and Restart
-
-2. **Compose preview not working**
- - Ensure you're using compatible Android Studio version
- - Check Compose compiler version compatibility
-
-3. **Navigation issues**
- - Verify navigation graph setup
- - Check route definitions
-
-### Debug Tips
-- Use Android Studio's Layout Inspector for UI debugging
-- Enable Compose debugging in developer options
-- Check Logcat for runtime errors
-
-## ๐ License
-
-This project is open source and available under the [MIT License](LICENSE).
-
-## ๐ค Contributing
-
-Contributions are welcome! Please feel free to submit a Pull Request.
-
-### Development Guidelines
-1. Fork the repository
-2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
-3. Follow Kotlin coding conventions
-4. Write tests for new features
-5. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
-6. Push to the branch (`git push origin feature/AmazingFeature`)
-7. Open a Pull Request
-
-## ๐ Support
-
-If you encounter any issues or have questions:
-1. Check the [Issues](https://github.com/Shivamtawar/QuizApp/issues) section
-2. Create a new issue with detailed information
-3. Contact the maintainer: [@Shivamtawar](https://github.com/Shivamtawar)
-
-## ๐ฎ Future Enhancements
-
-- [ ] Online quiz database integration
-- [ ] User authentication and profiles
-- [ ] Leaderboards and achievements
-- [ ] Multiplayer quiz mode
-- [ ] Offline mode support
-- [ ] Quiz creation tools
-- [ ] Social sharing features
-- [ ] Analytics and progress tracking
-- [ ] Voice questions support
-- [ ] Accessibility improvements
-
-## ๐ Version History
-
-- **v1.0** - Initial release with basic quiz functionality
-- Core quiz features
-- Material Design 3 implementation
-- Navigation setup
-
-## ๐ Acknowledgments
-
-- Android Jetpack Compose team
-- Material Design guidelines
-- Open source community
-
----
-
-**Made with โค๏ธ by [Shivam Tawar](https://github.com/Shivamtawar)**
-
-*Happy Quizzing! ๐*
diff --git a/QuizApp/app/build.gradle.kts b/QuizApp/app/build.gradle.kts
index 879bf03..f3f5251 100644
--- a/QuizApp/app/build.gradle.kts
+++ b/QuizApp/app/build.gradle.kts
@@ -2,6 +2,9 @@ plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
+ alias(libs.plugins.google.gms.google.services)
+ id("org.jetbrains.kotlin.plugin.serialization") version "1.9.23" // Add this line
+
}
android {
@@ -58,5 +61,12 @@ dependencies {
debugImplementation(libs.androidx.ui.test.manifest)
implementation("androidx.navigation:navigation-compose:2.7.5")
+ implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
+
+ // Import the BoM for the Firebase platform
+ implementation(platform("com.google.firebase:firebase-bom:34.3.0"))
+ // Add the dependency for the Firebase AI Logic library
+ // When using the BoM, you don't specify versions in Firebase library dependencies
+ implementation("com.google.firebase:firebase-ai")
}
\ No newline at end of file
diff --git a/QuizApp/app/src/main/AndroidManifest.xml b/QuizApp/app/src/main/AndroidManifest.xml
index 3482e8c..ab9c0a5 100644
--- a/QuizApp/app/src/main/AndroidManifest.xml
+++ b/QuizApp/app/src/main/AndroidManifest.xml
@@ -1,8 +1,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/HomeScreen.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/HomeScreen.kt
index d65a419..c2949e0 100644
--- a/QuizApp/app/src/main/java/com/example/quizappminiproject/HomeScreen.kt
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/HomeScreen.kt
@@ -8,7 +8,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
+import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
+import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -35,10 +37,11 @@ fun HomeScreen(
text = "Welcome to the Quiz App",
fontSize = 30.sp,
textAlign = TextAlign.Center,
- color = Color.White,
+ color = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.height(120.dp)
)
+
Spacer(modifier = Modifier.height(150.dp))
Button(
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/MainActivity.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/MainActivity.kt
index 3142d3b..085afbb 100644
--- a/QuizApp/app/src/main/java/com/example/quizappminiproject/MainActivity.kt
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/MainActivity.kt
@@ -1,5 +1,6 @@
package com.example.quizappminiproject
+import NavGraph
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
@@ -9,6 +10,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.quizappminiproject.ui.theme.QuizAppMiniProjectTheme
@@ -18,10 +20,11 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
- QuizAppMiniProjectTheme {
- NavGraph()
-
-
+ val themeManager = remember { ThemeManager(this) }
+ QuizAppMiniProjectTheme(
+ darkTheme = themeManager.isDarkTheme.value
+ ) {
+ NavGraph(themeManager = themeManager)
}
}
}
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/NavGraph.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/NavGraph.kt
index 774b2fd..97a38cc 100644
--- a/QuizApp/app/src/main/java/com/example/quizappminiproject/NavGraph.kt
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/NavGraph.kt
@@ -1,33 +1,37 @@
-package com.example.quizappminiproject
+// In your NavGraph.kt file
import androidx.compose.runtime.Composable
+import androidx.navigation.NavHostController
+import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
+import androidx.navigation.navArgument
+import com.example.quizappminiproject.HomeScreen
+import com.example.quizappminiproject.QuizScreen
+import com.example.quizappminiproject.ResultScreen
+import com.example.quizappminiproject.ThemeManager
@Composable
-fun NavGraph() {
-
- val navContrller = rememberNavController()
-
- NavHost(
- navController = navContrller,
- startDestination = "home"
- ) {
- composable("quiz"){
- QuizScreen(navContrller)
+fun NavGraph(
+ navController: NavHostController = rememberNavController(),
+ themeManager: ThemeManager
+) {
+ NavHost(navController = navController, startDestination = "home") {
+ composable("home") {
+ HomeScreen(navController = navController)
}
- composable("result/{score}"){ backStackEntry ->
- val score = backStackEntry.arguments?.getString("score")?.toIntOrNull() ?:0
- Score(score = score)
+ composable("quiz") {
+ QuizScreen(navController = navController)
}
- composable("home"){
- HomeScreen(navContrller)
-
+ composable(
+ route = "result/{score}",
+ arguments = listOf(navArgument("score") { type = NavType.IntType })
+ ) { backStackEntry ->
+ val score = backStackEntry.arguments?.getInt("score") ?: 0
+ ResultScreen(navController = navController, score = score)
}
-
-
}
+}
-}
\ No newline at end of file
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizApplication.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizApplication.kt
new file mode 100644
index 0000000..a6fc2f6
--- /dev/null
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizApplication.kt
@@ -0,0 +1,11 @@
+package com.example.quizappminiproject
+
+import android.app.Application
+import com.google.firebase.FirebaseApp
+
+class QuizApplication : Application() {
+ override fun onCreate() {
+ super.onCreate()
+ FirebaseApp.initializeApp(this)
+ }
+}
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizData.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizData.kt
new file mode 100644
index 0000000..efb64e1
--- /dev/null
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizData.kt
@@ -0,0 +1,15 @@
+package com.example.quizappminiproject
+
+import kotlinx.serialization.Serializable
+
+@Serializable
+data class QuizQuestion(
+ val question: String,
+ val options: List,
+ val correctAnswerIndex: Int
+)
+
+@Serializable
+data class QuizData(
+ val questions: List
+)
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizScreen.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizScreen.kt
index 8feed91..c26a9d9 100644
--- a/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizScreen.kt
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizScreen.kt
@@ -1,6 +1,5 @@
package com.example.quizappminiproject
-import android.widget.Toast
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
@@ -12,9 +11,13 @@ import androidx.compose.foundation.selection.selectable
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
+import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.LinearProgressIndicator
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@@ -22,123 +25,175 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
+import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavHostController
-
-//[question[option],question[option],question[option]]
@Composable
fun QuizScreen(
- navController: NavHostController
+ navController: NavHostController,
+ viewModel: QuizViewModel = viewModel()
) {
+ val uiState by viewModel.uiState.collectAsState()
- val context = LocalContext.current
-
- val question = listOf(
- "What is the capital of India??" to listOf("London", "Delhi", "Mumbai", "Pune"),
- "Which is the largest planet in our Solar System??" to listOf("Earth", "Mars", "Uranus", "Jupiter"),
- "what is 9 + 5??" to listOf("15", "36", "94", "14"),
- "Which is the national flower of India??" to listOf("Rose", "Hibiscus", "Lotus", "Jasmine"),
- "Which Sport is Leo Messi Associated to??" to listOf("Cricket", "Football", "Table Tennis", "Javelin")
- )
-
- val correctAnswers = listOf(1,3,3,2,1)
-
-// state variables
- var currentQuestionIndex by remember { mutableStateOf(0) }
- var selectedAnswer by remember { mutableStateOf(-1) }
- var score by remember { mutableStateOf(0) }
-
-// Current Question Data
- val currentquestion = question[currentQuestionIndex]
- val questiontext = currentquestion.first
- val options = currentquestion.second
-
-// actual ui building
Column(
modifier = Modifier
- .padding(16.dp)
- .fillMaxSize(),
+ .fillMaxSize()
+ .padding(16.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
- Text(
- text = "Question ${currentQuestionIndex + 1} of ${question.size}",
- fontSize = 14.sp,
- modifier = Modifier.padding(bottom = 8.dp)
- )
-
- LinearProgressIndicator(
- progress = (currentQuestionIndex + 1).toFloat()/ question.size,
- modifier = Modifier
- .fillMaxWidth()
- .padding(bottom = 24.dp)
- )
+ when (val state = uiState) {
+ is QuizUiState.Initial -> {
+ QuizTopicInput(onGenerateClick = { topic ->
+ viewModel.generateQuiz(topic)
+ })
+ }
+ is QuizUiState.Loading -> {
+ CircularProgressIndicator(color = MaterialTheme.colorScheme.primary)
+ Spacer(modifier = Modifier.height(8.dp))
+ Text(
+ text = "Generating your quiz...",
+ color = MaterialTheme.colorScheme.onBackground
+ )
+ }
+ is QuizUiState.Success -> {
+ QuizContent(
+ quizData = state.quizData,
+ viewModel = viewModel,
+ onQuizFinished = { score, totalQuestions ->
+ navController.navigate("result/$score")
+ }
-// Queston Text
- Text(
- text = questiontext,
- fontSize = 20.sp,
- fontWeight = FontWeight.Medium,
- modifier = Modifier.padding(bottom = 24.dp)
- )
-// options
- options.forEachIndexed{index, option ->
- Card(
- modifier = Modifier
- .fillMaxWidth()
- .padding(vertical = 4.dp)
- .selectable(
- selected = selectedAnswer == index,
- onClick = { selectedAnswer = index }
- ),
- colors = CardDefaults.cardColors(
- containerColor = if (selectedAnswer == index) Color.Blue else Color.White
)
- ) {
+ }
+ is QuizUiState.Error -> {
Text(
- text = option,
- modifier = Modifier.padding(16.dp),
- fontSize = 16.sp
+ text = "Error: ${state.message}",
+ color = MaterialTheme.colorScheme.error
)
-
+ Button(onClick = { viewModel.generateQuiz("Science") /* Or reset state */ }) {
+ Text("Retry")
+ }
}
}
+ }
+}
- Spacer(modifier = Modifier.height(16.dp))
+@Composable
+fun QuizTopicInput(onGenerateClick: (String) -> Unit) {
+ var topic by remember { mutableStateOf("") }
+
+ Text(
+ text = "Quiz App",
+ fontSize = 24.sp,
+ fontWeight = FontWeight.Bold,
+ color = MaterialTheme.colorScheme.onBackground
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ OutlinedTextField(
+ value = topic,
+ onValueChange = { topic = it },
+ label = { Text("Enter a topic for the quiz") },
+ modifier = Modifier.fillMaxWidth()
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ Button(
+ onClick = { onGenerateClick(topic) },
+ enabled = topic.isNotBlank(),
+ modifier = Modifier
+ .fillMaxWidth()
+ .height(56.dp)
+ ) {
+ Text("Generate Quiz", fontSize = 16.sp)
+ }
+}
- Button(
- onClick = {
- if (selectedAnswer == correctAnswers[currentQuestionIndex]){
- score++
- Toast.makeText(context, "Well done your Answer was correct Score = $score", Toast.LENGTH_SHORT).show()
- }
+@Composable
+fun QuizContent(
+ quizData: QuizData,
+ viewModel: QuizViewModel,
+ onQuizFinished: (Int, Int) -> Unit
+) {
+ val currentQuestionIndex by viewModel.currentQuestionIndex.collectAsState()
+ val selectedAnswer by viewModel.selectedAnswer.collectAsState()
+ val score by viewModel.score.collectAsState()
+ val quizFinished by viewModel.quizFinished.collectAsState()
- if(currentQuestionIndex < question.size - 1 ){
- currentQuestionIndex++
- selectedAnswer = -1
- }else{
- navController.navigate("result/$score")
- }
- },
- enabled = selectedAnswer != -1,
- modifier = Modifier.fillMaxWidth()
- .height(56.dp)
- ){
+ if (quizFinished) {
+ onQuizFinished(score, quizData.questions.size)
+ }
- Text(
- text = "Next Question",
- fontSize = 16.sp
- )
- }
+ val currentQuestion = quizData.questions[currentQuestionIndex]
+ val questionText = currentQuestion.question
+ val options = currentQuestion.options
+ Text(
+ text = "Question ${currentQuestionIndex + 1} of ${quizData.questions.size}",
+ fontSize = 14.sp,
+ color = MaterialTheme.colorScheme.onBackground,
+ modifier = Modifier.padding(bottom = 8.dp)
+ )
+ LinearProgressIndicator(
+ progress = { (currentQuestionIndex + 1).toFloat() / quizData.questions.size },
+ color = MaterialTheme.colorScheme.primary,
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(bottom = 24.dp)
+ )
+ Text(
+ text = questionText,
+ fontSize = 20.sp,
+ fontWeight = FontWeight.Medium,
+ color = MaterialTheme.colorScheme.onBackground,
+ modifier = Modifier.padding(bottom = 24.dp)
+ )
+ options.forEachIndexed { index, option ->
+ Card(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(vertical = 4.dp)
+ .selectable(
+ selected = selectedAnswer == index,
+ onClick = { viewModel.selectAnswer(index) }
+ ),
+ colors = CardDefaults.cardColors(
+ containerColor = if (selectedAnswer == index)
+ MaterialTheme.colorScheme.primary.copy(alpha = 0.3f)
+ else
+ MaterialTheme.colorScheme.surface
+ )
+ ) {
+ Text(
+ text = option,
+ modifier = Modifier.padding(16.dp),
+ fontSize = 16.sp,
+ color = if (selectedAnswer == index)
+ MaterialTheme.colorScheme.onPrimary
+ else
+ MaterialTheme.colorScheme.onSurface
+ )
+ }
}
+ Spacer(modifier = Modifier.height(16.dp))
+ Button(
+ onClick = {
+ viewModel.nextQuestion()
+ },
+ enabled = selectedAnswer != null,
+ modifier = Modifier
+ .fillMaxWidth()
+ .height(56.dp)
+ ) {
+ Text(
+ text = if (currentQuestionIndex < quizData.questions.size - 1) "Next Question" else "Finish Quiz",
+ fontSize = 16.sp
+ )
+ }
}
-
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizViewModel.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizViewModel.kt
new file mode 100644
index 0000000..5926db5
--- /dev/null
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/QuizViewModel.kt
@@ -0,0 +1,128 @@
+package com.example.quizappminiproject
+
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import com.google.firebase.Firebase
+import com.google.firebase.ai.ai
+import com.google.firebase.ai.type.Content
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.launch
+import kotlinx.serialization.json.Json
+
+sealed interface QuizUiState {
+ data object Initial : QuizUiState
+ data object Loading : QuizUiState
+ data class Success(val quizData: QuizData) : QuizUiState
+ data class Error(val message: String) : QuizUiState
+}
+
+class QuizViewModel : ViewModel() {
+
+ private val generativeModel = Firebase.ai.generativeModel(
+ modelName = "gemini-2.0-flash"
+ )
+
+ private val _uiState = MutableStateFlow(QuizUiState.Initial)
+ val uiState: StateFlow = _uiState.asStateFlow()
+
+ private val _currentQuestionIndex = MutableStateFlow(0)
+ val currentQuestionIndex: StateFlow = _currentQuestionIndex.asStateFlow()
+
+ private val _selectedAnswer = MutableStateFlow(null)
+ val selectedAnswer: StateFlow = _selectedAnswer.asStateFlow()
+
+ private val _score = MutableStateFlow(0)
+ val score: StateFlow = _score.asStateFlow()
+
+ private val _quizFinished = MutableStateFlow(false)
+ val quizFinished: StateFlow = _quizFinished.asStateFlow()
+
+ fun generateQuiz(topic: String) {
+ viewModelScope.launch {
+ _uiState.value = QuizUiState.Loading
+ try {
+ // Use text prompt instead of .functionCall
+ val prompt = """
+ Generate a 5-question multiple-choice quiz on the topic "$topic".
+ Respond only with JSON matching the QuizData structure:
+
+ {
+ "questions": [
+ {
+ "question": "string",
+ "options": ["string"],
+ "correctAnswerIndex": 0
+ }
+ ]
+ }
+ """.trimIndent()
+
+ val content = Content.Builder().text(prompt).build()
+ val response = generativeModel.generateContent(content)
+
+ val rawText = response.text.orEmpty()
+ val json = extractJson(rawText)
+
+ if (json.isNotBlank()) {
+ val quizData = Json.decodeFromString(json)
+ resetQuizState(quizData)
+ _uiState.value = QuizUiState.Success(quizData)
+ } else {
+ _uiState.value = QuizUiState.Error("Received empty or invalid quiz data")
+ }
+ } catch (e: Exception) {
+ _uiState.value = QuizUiState.Error(e.localizedMessage ?: "Unknown error")
+ }
+ }
+ }
+
+ private fun extractJson(response: String): String {
+ val hasFences = response.contains("```")
+ return if (hasFences) {
+ response.substringAfter("```json").substringBeforeLast("```").trim()
+ } else {
+ response.trim()
+ }
+ }
+
+ fun selectAnswer(index: Int) {
+ _selectedAnswer.value = index
+ }
+
+ fun nextQuestion() {
+ val currentState = _uiState.value
+ if (currentState is QuizUiState.Success) {
+ val quizData = currentState.quizData
+ val correctAnswerIndex = quizData.questions[_currentQuestionIndex.value].correctAnswerIndex
+ if (_selectedAnswer.value == correctAnswerIndex) _score.value += 1
+ if (_currentQuestionIndex.value < quizData.questions.size - 1) {
+ _currentQuestionIndex.value += 1
+ _selectedAnswer.value = null
+ } else {
+ _quizFinished.value = true
+ }
+ }
+ }
+
+ fun resetQuiz() {
+ val currentState = _uiState.value
+ if (currentState is QuizUiState.Success) resetQuizState(currentState.quizData)
+ else {
+ _currentQuestionIndex.value = 0
+ _selectedAnswer.value = null
+ _score.value = 0
+ _quizFinished.value = false
+ _uiState.value = QuizUiState.Initial
+ }
+ }
+
+ private fun resetQuizState(quizData: QuizData) {
+ _currentQuestionIndex.value = 0
+ _selectedAnswer.value = null
+ _score.value = 0
+ _quizFinished.value = false
+ _uiState.value = QuizUiState.Success(quizData)
+ }
+}
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/ResultScreen.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/ResultScreen.kt
new file mode 100644
index 0000000..a4409be
--- /dev/null
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/ResultScreen.kt
@@ -0,0 +1,45 @@
+package com.example.quizappminiproject
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.height
+import androidx.compose.material3.Button
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
+
+@Composable
+fun ResultScreen(navController: NavHostController, score: Int) {
+ Column(
+ modifier = Modifier.fillMaxSize(),
+ verticalArrangement = Arrangement.Center,
+ horizontalAlignment = Alignment.CenterHorizontally
+ ) {
+ Text(
+ text = "Quiz Finished!",
+ fontSize = 24.sp,
+ color = MaterialTheme.colorScheme.onBackground
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ Text(
+ text = "Your Score: $score",
+ fontSize = 20.sp,
+ color = MaterialTheme.colorScheme.onBackground
+ )
+ Spacer(modifier = Modifier.height(32.dp))
+ Button(onClick = {
+ navController.navigate("home") {
+ popUpTo("home") { inclusive = true }
+ }
+ }) {
+ Text("Play Again")
+ }
+ }
+}
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/ScoreScreen.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/ScoreScreen.kt
index e115b97..d234052 100644
--- a/QuizApp/app/src/main/java/com/example/quizappminiproject/ScoreScreen.kt
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/ScoreScreen.kt
@@ -19,7 +19,8 @@ import androidx.compose.foundation.layout.height
@Composable
fun Score(
- score : Int
+ score : Int,
+ totalQuestions: Int
)
{
@@ -56,7 +57,7 @@ fun Score(
)
Text(
- text = "0$score / 05",
+ text = "$score / $totalQuestions",
fontSize = 36.sp,
fontWeight = FontWeight.Bold,
color = Color.Black
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/ThemeManager.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/ThemeManager.kt
new file mode 100644
index 0000000..a1cff46
--- /dev/null
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/ThemeManager.kt
@@ -0,0 +1,27 @@
+package com.example.quizappminiproject
+
+import android.content.Context
+import android.content.SharedPreferences
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.State
+
+class ThemeManager(context: Context) {
+ private val sharedPreferences: SharedPreferences =
+ context.getSharedPreferences("theme_preferences", Context.MODE_PRIVATE)
+
+ private val _isDarkTheme = mutableStateOf(
+ sharedPreferences.getBoolean("is_dark_theme", false)
+ )
+ val isDarkTheme: State = _isDarkTheme
+
+ fun toggleTheme() {
+ val newTheme = !_isDarkTheme.value
+ _isDarkTheme.value = newTheme
+ sharedPreferences.edit().putBoolean("is_dark_theme", newTheme).apply()
+ }
+
+ fun setTheme(isDark: Boolean) {
+ _isDarkTheme.value = isDark
+ sharedPreferences.edit().putBoolean("is_dark_theme", isDark).apply()
+ }
+}
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Color.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Color.kt
index 766757f..31b83a5 100644
--- a/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Color.kt
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Color.kt
@@ -2,10 +2,35 @@ package com.example.quizappminiproject.ui.theme
import androidx.compose.ui.graphics.Color
+// Light Theme Colors
val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
-val Pink40 = Color(0xFF7D5260)
\ No newline at end of file
+val Pink40 = Color(0xFF7D5260)
+
+// Quiz App Specific Colors for Light Theme
+val QuizPrimary = Color(0xFF1976D2) // Blue
+val QuizSecondary = Color(0xFF388E3C) // Green
+val QuizTertiary = Color(0xFFF57C00) // Orange
+val QuizBackground = Color(0xFFFFFBFE)
+val QuizSurface = Color(0xFFFFFFFF)
+val QuizError = Color(0xFFD32F2F) // Red
+
+// Quiz App Specific Colors for Dark Theme
+val QuizPrimaryDark = Color(0xFF90CAF9) // Light Blue
+val QuizSecondaryDark = Color(0xFF81C784) // Light Green
+val QuizTertiaryDark = Color(0xFFFFB74D) // Light Orange
+val QuizBackgroundDark = Color(0xFF121212)
+val QuizSurfaceDark = Color(0xFF1E1E1E)
+val QuizErrorDark = Color(0xFFEF5350) // Light Red
+
+// Additional UI Colors
+val QuizOnPrimary = Color.White
+val QuizOnPrimaryDark = Color.Black
+val QuizOnBackground = Color(0xFF010101)
+val QuizOnBackgroundDark = Color(0xFFE6E1E5)
+val QuizOnSurface = Color(0xFF1C1B1F)
+val QuizOnSurfaceDark = Color(0xFFE6E1E5)
diff --git a/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Theme.kt b/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Theme.kt
index 698efa3..0a6d6d6 100644
--- a/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Theme.kt
+++ b/QuizApp/app/src/main/java/com/example/quizappminiproject/ui/theme/Theme.kt
@@ -9,35 +9,47 @@ import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.SideEffect
+import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalView
+import androidx.core.view.WindowCompat
private val DarkColorScheme = darkColorScheme(
- primary = Purple80,
- secondary = PurpleGrey80,
- tertiary = Pink80
+ primary = QuizPrimaryDark,
+ secondary = QuizSecondaryDark,
+ tertiary = QuizTertiaryDark,
+ background = QuizBackgroundDark,
+ surface = QuizSurfaceDark,
+ error = QuizErrorDark,
+ onPrimary = QuizOnPrimaryDark,
+ onSecondary = QuizOnPrimaryDark,
+ onTertiary = QuizOnPrimaryDark,
+ onBackground = QuizOnBackgroundDark,
+ onSurface = QuizOnSurfaceDark,
+ onError = QuizOnPrimaryDark,
)
private val LightColorScheme = lightColorScheme(
- primary = Purple40,
- secondary = PurpleGrey40,
- tertiary = Pink40
-
- /* Other default colors to override
- background = Color(0xFFFFFBFE),
- surface = Color(0xFFFFFBFE),
- onPrimary = Color.White,
- onSecondary = Color.White,
- onTertiary = Color.White,
- onBackground = Color(0xFF1C1B1F),
- onSurface = Color(0xFF1C1B1F),
- */
+ primary = QuizPrimary,
+ secondary = QuizSecondary,
+ tertiary = QuizTertiary,
+ background = QuizBackground,
+ surface = QuizSurface,
+ error = QuizError,
+ onPrimary = QuizOnPrimary,
+ onSecondary = QuizOnPrimary,
+ onTertiary = QuizOnPrimary,
+ onBackground = QuizOnBackground,
+ onSurface = QuizOnSurface,
+ onError = QuizOnPrimary,
)
@Composable
fun QuizAppMiniProjectTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
- dynamicColor: Boolean = true,
+ dynamicColor: Boolean = false, // Disabled to use our custom colors
content: @Composable () -> Unit
) {
val colorScheme = when {
@@ -50,6 +62,15 @@ fun QuizAppMiniProjectTheme(
else -> LightColorScheme
}
+ val view = LocalView.current
+ if (!view.isInEditMode) {
+ SideEffect {
+ val window = (view.context as Activity).window
+ window.statusBarColor = colorScheme.primary.toArgb()
+ WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
+ }
+ }
+
MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
diff --git a/QuizApp/build.gradle.kts b/QuizApp/build.gradle.kts
index 952b930..27faa7f 100644
--- a/QuizApp/build.gradle.kts
+++ b/QuizApp/build.gradle.kts
@@ -3,4 +3,6 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
+ alias(libs.plugins.google.gms.google.services) apply false
+
}
\ No newline at end of file
diff --git a/QuizApp/gradle/libs.versions.toml b/QuizApp/gradle/libs.versions.toml
index db7c919..5addfcd 100644
--- a/QuizApp/gradle/libs.versions.toml
+++ b/QuizApp/gradle/libs.versions.toml
@@ -8,6 +8,8 @@ espressoCore = "3.6.1"
lifecycleRuntimeKtx = "2.9.1"
activityCompose = "1.10.1"
composeBom = "2024.04.01"
+googleGmsGoogleServices = "4.4.3"
+firebaseAi = "17.3.0"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@@ -24,9 +26,11 @@ androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-toolin
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
+firebase-ai = { group = "com.google.firebase", name = "firebase-ai", version.ref = "firebaseAi" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
+google-gms-google-services = { id = "com.google.gms.google-services", version.ref = "googleGmsGoogleServices" }
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5a43c84
--- /dev/null
+++ b/README.md
@@ -0,0 +1,126 @@
+# Android Quiz App ๐
+
+A modern Android quiz application built with Kotlin and Jetpack Compose that provides an interactive quiz experience with multiple-choice questions and navigation between different screens.
+
+## ๐ฑ Screenshots
+
+| Home Screen | Quiz Interface | Question Screen |
+|-------------|----------------|-----------------|
+|  |  | .jpeg) |
+
+| Results Screen | Score Display | App Overview |
+|----------------|---------------|--------------|
+|  | .jpeg) |  |
+
+## โจ Features
+
+- ๐ฏ Interactive quiz interface with multiple-choice questions
+- ๐จ Modern Material Design 3 UI
+- ๐งญ Smooth navigation between quiz screens
+- ๐ Score tracking and results display
+- ๐ฑ Clean and intuitive user experience
+- โก Built with latest Android development technologies
+
+## ๐ ๏ธ Tech Stack
+
+- **Language**: Kotlin
+- **UI Framework**: Jetpack Compose
+- **Architecture**: Modern Android Architecture
+- **Navigation**: Navigation Compose
+- **Design System**: Material Design 3
+- **Min SDK**: 24 (Android 7.0)
+- **Target SDK**: 34
+- **Compile SDK**: 35
+
+## ๏ฟฝ Quick Start
+
+### Prerequisites
+- Android Studio (Latest version)
+- JDK 11 or higher
+- Android device/emulator with API level 24+
+
+### Installation
+1. Clone the repository:
+ ```bash
+ git clone https://github.com/Elementx07/Android-Quiz-App.git
+ cd Android-Quiz-App/QuizApp
+ ```
+
+2. Open in Android Studio and sync dependencies
+
+3. Build and run the app on your device/emulator
+
+## ๐ฎ How to Play
+
+1. **Start Screen**: Launch the app and tap "Start Quiz"
+2. **Quiz Interface**: Answer multiple-choice questions by selecting your choice
+3. **Navigation**: Use Next/Previous buttons to navigate through questions
+4. **Results**: View your final score and performance feedback
+5. **Restart**: Take the quiz again to improve your score
+
+## ๏ฟฝ๏ธ Key Components
+
+- **MainActivity**: App entry point with navigation setup
+- **QuizScreen**: Main quiz interface and question display
+- **ResultScreen**: Score display and performance feedback
+- **Navigation**: Screen transitions and app flow management
+- **ThemeManager**: Material Design 3 theming and customization
+
+## ๐ Features Overview
+
+### Quiz Experience
+- Multiple-choice questions with instant feedback
+- Progress tracking throughout the quiz
+- Score calculation and performance analysis
+- Clean Material Design 3 interface
+
+### Navigation
+- Smooth transitions between screens
+- Intuitive back navigation
+- Deep linking support for specific quiz sections
+
+### User Interface
+- Modern Jetpack Compose UI
+- Dark/Light theme support
+- Responsive design for different screen sizes
+- Accessibility features included
+
+## ๐งช Development
+
+### Running Tests
+```bash
+# Unit tests
+./gradlew test
+
+# Instrumented tests
+./gradlew connectedAndroidTest
+```
+
+### Building APK
+```bash
+# Debug APK
+./gradlew assembleDebug
+
+# Release APK
+./gradlew assembleRelease
+```
+
+## ๐ค Contributing
+
+1. Fork the repository
+2. Create a feature branch: `git checkout -b feature/new-feature`
+3. Commit changes: `git commit -m 'Add new feature'`
+4. Push to branch: `git push origin feature/new-feature`
+5. Submit a Pull Request
+
+## ๏ฟฝ License
+
+This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+## ๐จโ๏ฟฝ Developer
+
+Created with โค๏ธ by [Elementx07](https://github.com/Elementx07)
+
+---
+
+*Happy Learning! ๐ Test your knowledge with this interactive quiz app.*
diff --git a/WhatsApp Image 2025-10-09 at 3.57.33 PM.jpeg b/WhatsApp Image 2025-10-09 at 3.57.33 PM.jpeg
new file mode 100644
index 0000000..c35c474
Binary files /dev/null and b/WhatsApp Image 2025-10-09 at 3.57.33 PM.jpeg differ
diff --git a/WhatsApp Image 2025-10-09 at 3.57.34 PM(1).jpeg b/WhatsApp Image 2025-10-09 at 3.57.34 PM(1).jpeg
new file mode 100644
index 0000000..3354782
Binary files /dev/null and b/WhatsApp Image 2025-10-09 at 3.57.34 PM(1).jpeg differ
diff --git a/WhatsApp Image 2025-10-09 at 3.57.34 PM.jpeg b/WhatsApp Image 2025-10-09 at 3.57.34 PM.jpeg
new file mode 100644
index 0000000..7e715e1
Binary files /dev/null and b/WhatsApp Image 2025-10-09 at 3.57.34 PM.jpeg differ
diff --git a/WhatsApp Image 2025-10-09 at 3.57.35 PM(1).jpeg b/WhatsApp Image 2025-10-09 at 3.57.35 PM(1).jpeg
new file mode 100644
index 0000000..0d2b079
Binary files /dev/null and b/WhatsApp Image 2025-10-09 at 3.57.35 PM(1).jpeg differ
diff --git a/WhatsApp Image 2025-10-09 at 3.57.35 PM.jpeg b/WhatsApp Image 2025-10-09 at 3.57.35 PM.jpeg
new file mode 100644
index 0000000..542113d
Binary files /dev/null and b/WhatsApp Image 2025-10-09 at 3.57.35 PM.jpeg differ
diff --git a/WhatsApp Image 2025-10-09 at 3.57.36 PM.jpeg b/WhatsApp Image 2025-10-09 at 3.57.36 PM.jpeg
new file mode 100644
index 0000000..6bd97fd
Binary files /dev/null and b/WhatsApp Image 2025-10-09 at 3.57.36 PM.jpeg differ