Facebook Twitter Instagram
    DeepCrazyWorld
    Facebook Twitter Instagram Pinterest YouTube
    • FLUTTER
      • FLUTTER APP
        • QRCode
        • Quiz App
        • Chat GPT
        • PDF App
        • News App
        • Fitness App
        • Weather App
        • BMI Calculator
        • GAME APP
        • Ecommerce App
        • wallpaper App
        • Finance app
        • Chat App
        • Wallet App
        • Taxi App
        • Quran app
        • Music player app
      • FLUTTER UI
        • Splash Screen
        • Onboarding Screen
        • Login Screen
        • Card Design
        • Drawer
    • PROJECT
      • Android Projects
      • College Projects
      • FLUTTER APP
      • Project Ideas
      • PHP Projects
      • Python Projects
    • SOURCE CODE
    • ANDROID
      • ANDROID APP
      • GAME APP
      • ANDROID STUDIO
    • MCQ
      • AKTU MCQ
        • RPA MCQ
        • COA MCQ
        • HPC MCQ
        • SPM MCQ
        • Renewable Energy All MCQ
        • Data Compression MCQ
        • Data Structure MCQ
        • Digital Image Processing MCQ
        • Software Engineering MCQ
        • Machine Learning MCQ
        • Artificial Intelligence MCQ
      • D PHARMA MCQ
        • Pharmaceutics – I MCQ
        • Pharmacognosy MCQ
        • Pharmaceutical Chemistry MCQ
        • Biochemistry and Clinical Pathology MCQ
        • Human Anatomy and Physiology MCQ
        • Heath Education and Community Pharmacy MCQ
    • INTERVIEW QUESTIONS
      • Flutter Interview Questions
      • INTERVIEW QUESTIONS
      • Python Interview Questions
      • Coding ninjas solution
    • MORE
      • WORDPRESS
        • SEO
        • TOP 10 WORDPRESS THEME
      • PRODUCTIVITY
      • Program
      • QUOTES
    DeepCrazyWorld
    Home»ANDROID»Quiz App in Android studio source code free – Android Tutorial
    ANDROID

    Quiz App in Android studio source code free – Android Tutorial

    DeepikaBy DeepikaJuly 13, 2020Updated:April 17, 2023No Comments5 Mins Read

    Quiz App is an android based application, and enables the user to undertake a series of questions on Java language. The app is user friendly, and the user shall find it extremely easy to answer the multiple-choice questions. At the end of the quiz, a result-report is generated which states the score. The Quiz app also presents an option to the current user to play the question-round again or quit in between.

    This Quiz App was developed as a learning project for Android. It is developed in Android Studio 3.6

    • compileSdkVersion – 29
    • buildToolVersion – 28-0-3
    • minSdkVersion – 17
    • targetSdkVersion -29

    Again that we are well versed with Activity, Layout, Views etc its time to get our hands dirty, and create our second application. This application will have a science quiz app, and user will have option to answer in True or False. Based on what the user enters, we will show the user, whether they selected the correct option or not by simply showing a message saying Correct or Incorrect.

    <img decoding=

    For Quiz App Open Android Studio and go to File → New → New Project. In the New Project window, enter the Application Name as Quiz and company domain as com.technic.quiz and Click on Next.

    Table of Contents

    Toggle
    • MainActivity
    • Layout File of Quiz
    • Manifest File for Quiz
    • YouTube Video
    • Quiz app Download Source Code
        • Click below to get the source code android Quiz application.
          • Download Quiz Apk: Click Here
          • Quiz Logo Download: Click Here
    • Download Source Code
    • Conclusion
      • Cheers!
    • READ MORE…

    MainActivity

    package com.technic.javaquizapp;
    
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.graphics.Typeface;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.TextView;
    import android.widget.Toast;
    
    import androidx.appcompat.app.AlertDialog;
    import androidx.appcompat.app.AppCompatActivity;
    
    
    
    public class MainActivity extends AppCompatActivity {
        Button playGame,quit,share;
        TextView textView;
    
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_home_screen);
            setTitle("");
    
            //the below method will initialize views
            initViews();
    
            //PlayGame button - it will take you to the MainGameActivity
            playGame.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent intent = new Intent(MainActivity.this, GameActivity.class);
                    startActivity(intent);
                    finish();
                }
            });
    
    
            //Quit button - This will quit the game
            share.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
    
                    Intent sharingIntent = new Intent(Intent.ACTION_SEND);
                    sharingIntent.setType("text/plain");
                    sharingIntent.putExtra(Intent.EXTRA_TEXT, "Try this new ** App   ");
                    sharingIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
                    startActivity(Intent.createChooser(sharingIntent, "Share using"));
    
                }
            });
    
    
            //Quit button - This will quit the game
            quit.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this)
                            .setIcon(R.drawable.alrt)
    
                            .setTitle("Are you sure to Exit")
                            .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialogInterface, int i) {
                                    //set what would happen when positive button is clicked
                                    finish();
                                }
                            })
    
                            .setNegativeButton("No", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialogInterface, int i) {
                                    //set what should happen when negative button is clicked
                                    Toast.makeText(getApplicationContext(), "Welcome Back", Toast.LENGTH_LONG).show();
                                }
                            })
                            .show();
                }
            });
        }
    
        private void initViews() {
            //initialize views here
            playGame =(Button)findViewById(R.id.playGame);
            quit = (Button) findViewById(R.id.exit);
            textView = (TextView)findViewById(R.id.tQ);
            share = (Button)findViewById(R.id.share);
    
    
            //Typeface - this is for fonts style
            Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/main-Bold.otf");
            playGame.setTypeface(typeface);
            quit.setTypeface(typeface);
            textView.setTypeface(typeface);
    
    
    
    
        }
    }
    

    In the next step you will be asked to select the targeted device, on which your application will be supported. Let’s stick with Phone and Tablet for this Quiz App application. And in the drop down saying Minimum SDK choose API 16: Android 4.1 (Jelly Bean), this means our App will work on all the Phones and Tablets with Android Version 4.1 till 7(the latest version). Click on Next button.

    Layout File of Quiz

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:fbutton="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:gravity="center_horizontal"
        tools:context=".MainActivity">
    
        <TextView
            android:id="@+id/tQ"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/app_name"
            android:textColor="#2b2b2b"
            android:textSize="50sp"
            android:textStyle="bold"
            android:background="@drawable/quiz_bg"
            android:layout_marginTop="10dp"
            android:padding="5dp"
    
            />
    
        <View
        android:layout_width="match_parent"
        android:layout_height="20dp"
            android:layout_marginTop="50dp"
            />
    
    <ImageView
        android:layout_marginTop="-50dp"
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:src="@drawable/logo"
        android:layout_marginBottom="10dp"
        />
    
    
    
    
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
    
            >
    
            <Button
                android:layout_marginBottom="10dp"
                android:id="@+id/playGame"
                android:background="@drawable/button_bg"
                android:layout_width="300dp"
                android:text="Play Game"
                android:layout_height="wrap_content"
                android:textColor="@color/white"
                />
    
    
        <Button
            android:layout_marginBottom="10dp"
            android:textColor="@color/white"
            android:id="@+id/share"
            android:background="@drawable/button_bg"
            android:layout_width="300dp"
            android:text="SHARE"
            android:layout_height="wrap_content" />
    
    
        <Button
            android:layout_marginBottom="10dp"
            android:textColor="@color/white"
            android:id="@+id/exit"
            android:background="@drawable/button_bg"
            android:layout_width="300dp"
            android:text="QUIT"
            android:layout_height="wrap_content" />
    
    
    
        </LinearLayout>
    
    
    
    </LinearLayout>
    

    Now its time to add the first Activity to our application. Select the Empty Activity from the avilable options. And click on Next.

    Enter the activity name to be MainActivity, and Android Studio will automatically fill the layout file name. It is a standard practice to add suffix Activity in the Activity names and we will follow it. And for layout XML file, it is all words in small and in reverse order, separated by underscore _. Click on Finish to create the Quiz app project.

    Manifest File for Quiz

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.technic.javaquizapp">
    
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
            <activity android:name=".MainActivity"
                >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".GameOverActivity" />
            <activity android:name=".WonActivity" />
            <activity android:name=".TimeOverActivity" />
            <activity android:name=".GameActivity">
    
            </activity>
        </application>
    
    </manifest>

    Android Studio will take some time, to build everything, so be a little patient. Once Android Studio finished building your project, you will see a new project added to the left project tool window, the activity file will be open and in the Preview tool window you will see the preview for your app. Quiz App-If the Preview tool window in not open, go to View → Tool Windows → Preview, and the preview window will show up on the right side. Make other Java Quiz App Click Here.

    YouTube Video

    There are four Activities in the app :

    Main – displays Home Screen of application.
    Questions – displays MCQ’s and currents Score.
    Results – displays Results after finishing the quiz.
    Developers – displays the information about the developers.

    Quiz app Download Source Code

    Click below to get the source code android Quiz application.

    Download Quiz Apk: Click Here
    Quiz Logo Download: Click Here

    Download Source Code

    Click below to get the full source code android Quiz App application.

    GO TO DOWNLOAD PAGE

    Conclusion

    We have successfully created a Quiz App Android application using Android Studio.


    Cheers!

    READ MORE…

    Share. Facebook Twitter LinkedIn WhatsApp Telegram Pinterest Reddit Email
    Previous ArticleQR Code Scanner Android app in Android Studio with source code
    Next Article Quiz App in Android studio source code free – Android Tutorial

    Related Posts

    Quizler: A simple beautiful Quiz app built with Flutter

    Quiz App 2 Mins Read

    A Flutter MCQ quiz app with firebase google login

    Quiz App 2 Mins Read

    A simple quiz app for weebs made with flutter source code

    Quiz App 2 Mins Read

    How to Make Car Racing Game App with Android Studio

    ANDROID 2 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Implementing a Dynamic FAQ Screen UI in Flutter Using ExpansionTile March 29, 2025
    • Creating an Instruction UI Screen in Flutter Application March 29, 2025
    • Animated Backgrounds in Flutter: A Complete Guide March 15, 2025
    • How to make Diary App using flutter stepwise using getx August 31, 2024
    • How to Create Music Player UI screen with fully functional in flutter August 30, 2024
    • How to make ListView Builder Ui in flutter with Source Code August 29, 2024
    • Create a TabBar View in flutter with fully functional stepwise August 28, 2024
    • How to create TabBar view in flutter with source code step wise August 27, 2024
    • How to make Heart rate measure app with Flutter stepwise August 26, 2024
    • How to make ChatGpt App in flutter with source code Stepwise August 25, 2024
    Facebook Twitter Instagram Pinterest YouTube
    • About
    • Contact
    • Disclaimer
    • Privacy Policy
    Copyright by DeepCrazyWorld © 2025

    Type above and press Enter to search. Press Esc to cancel.