QuizApp
Application Preview
Description
QuizApp is a mobile quiz application that allows users to test their knowledge across various categories. The app includes a login feature, four main fragments for navigating between different quiz sections, and a leaderboard to display the top scores.
Features
Login: User authentication to access the application.
On the login page, users can log in using a nickname of 1 to 5 characters. If no nickname is provided, a toast message will inform the user that they cannot log in. Once logged in, the nickname is stored in SharedPreferences
.
Categories: Selecting a quiz category.
On the categories page, a welcome message is displayed. Several themes are loaded from the database, each with its own icon. Once a theme is clicked, it makes an API call to https://quizzapi.jomoreschi.fr/
.
Quiz: A quiz with questions related to the chosen category.
10 questions are fetched from the API and displayed one by one. Buttons are randomly generated to avoid answers being in the same position every time. The player has 10 seconds to answer:
- If they choose incorrectly, the correct answer is displayed, flashing green, while their answer turns red.
- If they answer correctly, their answer turns green and their score increases.
- If they don't answer in time, the correct answer flashes green. Once the correct answer is displayed, the next question appears after a 2-second delay.
After all 10 questions are answered, the score is saved to the database. The player can change the phone’s orientation without affecting the game. Additionally, they can return to the categories page at any time, which will end the game.
Score: Displaying the score at the end of each game.
Once the game is over, the score is displayed along with the top scores in the category played. The player can then return to the categories page to play again.
Leaderboard: Displaying the top scores.
On the Leaderboard
page, the player can see the top 3 scores across all categories.
Logout
The player can log out to allow another player to enjoy the game.
Application Structure
- LoginActivity: Login activity.
- MainActivity: Main activity containing multiple fragments:
- Fragments:
CategoriesFragment
: Selection of quiz category.QuizFragment
: Quiz questions.ScoreFragment
: Final score display.LeaderboardFragment
: Top scores leaderboard.
- Fragments:
Installation
- Development Installation
a. Clone the repository:
git clone https://github.com/Dinholu/quizapp.git