Mobile Application Development: Quiz Game

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

Mobile Application

Development

2021-22

Quiz Game
Submitted by
1. Bharat Khalate

Guided By: Asma Hannure mam


CERTIFICATE

MAHARASHTRASTATEBOARDOFTECHNICAL
EDUCATION, MUMBAI

GOVERNMENT POLYTECHNIC, SOLAPUR.

This is to certify that Bharat Khalate Roll no 86 Of 6th Semester


of Diploma in Computer Technology has satisfactory completed
Report Work in this subject Mobile application development
under the guidance of Ms. Asma Hannure mam the academic year
2021-2022 as prescribed in the curriculum.

Place: Enrollmentno:1900150332

Date: Exam seat no:

Subject teacher. HOD. Principal


2
Acknowledgement

We wish to express our profound and sincere gratitude to our guide, who Asma
Hannure mam guided us in the structure of micro project as well as some main points
in that micro project also they cleared our all doubts about micro project. We are
Indebted to his constant encouragement, co-operation and help. It was his enthusiastic
support that helped us in overcoming various obstacles in the project.
We would also like to express our thankfulness to our beloved Principal as well as
HOD and other faculty members of our Second-year department for extending their
support and motivation
Finally, we completed our micro project that regarding to our syllabus as well as
department, Once more thanks for all Group members, Respected Asma Hannure
mam , Principal, HOD and other Faculty Members who helped us in the micro project
completion.

Thank You...!!!

3
PART A – Micro-Project Proposal

1.0 Brief Introduction


In this Micro-Project we are going to make Quiz Game programs in Android, In this
project I am asking some questions and judjing them by their performance

2.0 Aim of the Micro-Project (in about 1 to 2 Sentences)


The aim of this project to develop programming skill and make Micro-Project for
Mobile application.

3.0 Intended Course Outcomes


a. Develop application using android.
b. Develop application using java.

4.0 Literature Review


We searched information for the suggested topic by our project guide.
Collected the data required for the micro –project.

5.0 Proposed Methodology


1. First searched information for the suggested micro-project.
2. Collected information for the suggested topic.
3. Started for the micro-project.
4. Completed micro-project.
5. Showed to respected teacher.
6. Teacher suggested some changes.
7. Done the changes into the project as told by teacher.

6.0 Resources Required.

S. No. Name of Specifications Qty Remarks


Resource/material 4
1 Computer System Intel core2duo Processor 4th 1 -
gen
2 GB RAM ,160GB HDD
2 Notepad Version 1909 1 -

7.0 Action Plan

Sr. Details of activity Name of responsible team


no member
1 Topic selection

2 Information Collection related to the topic

3 System Designing
1. Bharat Khalate
4 Data collection for the project

7 Testing

8 Error/Defect handling

10 Project report forming

Index
5
Sr.no Topic

1 Information about project

2 Advantages

3 Course Outcomes

4 Literature Review

5 Actual Methodology

6 Resources

7 Source Code

8 Outputs

9 Skill Developed

10 Application

11 Area of Future

12 Conclusion & Reference website

6
Information about project

A quiz is a form of game or mind sport in which players attempt to


answer questions correctly about a certain or variety of subjects. Quizzes can be
used as a brief assessment in education and similar fields to measure growth in
knowledge, abilities, or skills.
They can also be televised for entertainment purposes, often in a game show format.
In an educational context, a quiz is usually a form of a student assessment, but often
has fewer questions of less difficulty and requires less time for completion than a test.
Some instructors schedule a daily or weekly quiz ranging from five to thirty
relatively easy questions for the purpose of having the students review their previous
lessons before attending the next class

Advantages
7
 This application is simple to use.
 You can see your option submitted is right or wrong in bottom of screen
 In this project i used the radio group having four radio button
 You can see the total score at last
 Application is very light

Course Outcomes
a. Develop application using android.
b. Develop application using java.

Literature Review
In This Micro-Project we created a Application which convert one number system to
another number system .We made this Micro-Project Using Android studio we use java to
developed this application using java. This Micro Project contains limited features but the
essential one. The User can get to know about the source code whichever he need.

Actual Methodology
 Collected information for the suggested topic.
 Started the Micro-project.
 Completed Micro-project.
 Showed to respected teacher.
 Submitted the Micro-project.

Resources
1. Software-JDK
2. Software-SDK 8
3. IDE-android studio
4. Windows 10
5. YouTube: Some programming

Source Code

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@color/black_shade_2">

<TextView
android:id="@+id/tvh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome To Quiz Game"
android:textColor="@color/yellow"
android:textSize="33dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.136" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btns"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Start!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.53"
9
tools:ignore="TextContrastCheck"
android:background="@drawable/btn_gol"/>

<TextView
android:id="@+id/tvq"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sfgjsfgfsgjsc"
android:textColor="@color/yellow"
android:textSize="35dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.143"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.267" />

<RadioGroup
android:id="@+id/rg"
android:layout_width="358dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<RadioButton
android:id="@+id/rb1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abcd"
android:textColor="@color/yellow"
android:textSize="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.095"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.407" />

<RadioButton
android:id="@+id/rb2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abcd"
android:textColor="@color/yellow"
android:textSize="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.095"
10
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.477" />

<RadioButton
android:id="@+id/rb3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abcd"
android:textColor="@color/yellow"
android:textSize="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.095"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.547" />

<RadioButton
android:id="@+id/rb4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abcd"
android:textColor="@color/yellow"
android:textSize="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.095"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.617" />
</RadioGroup>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_gol"
android:text="Next!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.808"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java
11
package com.example.quizgamebybharat;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.view.Gravity;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {


TextView h, q;
Button btns, btnn;
RadioGroup rg;
RadioButton rb1, rb2, rb3, rb4;
int flag = 1, sc = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getSupportActionBar().hide();
setContentView(R.layout.activity_main);
h = (TextView) findViewById(R.id.tvh);
q = (TextView) findViewById(R.id.tvq);
btns = (Button) findViewById(R.id.btns);
btnn = (Button) findViewById(R.id.btnn);
rg = (RadioGroup) findViewById(R.id.rg);
rb1 = (RadioButton) findViewById(R.id.rb1);
rb2 = (RadioButton) findViewById(R.id.rb2);
rb3 = (RadioButton) findViewById(R.id.rb3);
rb4 = (RadioButton) findViewById(R.id.rb4);
q.setVisibility(View.INVISIBLE);
rb1.setVisibility(View.INVISIBLE);
rb1.setVisibility(View.INVISIBLE);
rb2.setVisibility(View.INVISIBLE);
rb3.setVisibility(View.INVISIBLE);
rb4.setVisibility(View.INVISIBLE);
btnn.setVisibility(View.INVISIBLE);
btns.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
q.setVisibility(View.VISIBLE);
rb1.setVisibility(View.VISIBLE);
rb1.setVisibility(View.VISIBLE);
rb2.setVisibility(View.VISIBLE);
rb3.setVisibility(View.VISIBLE);
rb4.setVisibility(View.VISIBLE);
btnn.setVisibility(View.VISIBLE);
h.setVisibility(View.INVISIBLE);
btns.setVisibility(View.INVISIBLE);
q.setText("1.Which is the most successful Team of IPL");
rb1.setText("1.MI");
rb2.setText("2.CSK");
rb3.setText("3.RR");
12
rb4.setText("4.DC");
/* if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb1).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}*/
btnn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
{ rb1.setChecke
d(false);
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("2.Capital of India is ");
rb1.setText("1.Chennai");
rb2.setText("2.Banglore");
rb3.setText("3.Mumbai");
rb4.setText("4.Delhi");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb1).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("3.Capital of maharashtra is");
rb1.setText("1.Nagpur");
rb2.setText("2.Pune");
rb3.setText("3.Mumbai");
rb4.setText("4.Delhi");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb4).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("4.Who is the first prime minister of India");
rb1.setText("1.Pandit Javaharlal Neharu");
rb2.setText("2.BharatRatna Indira Gandhi");
rb3.setText("3.BharatRatna Atal Bihari Vajpayee ");
rb4.setText("4.H.D. DEve Gowda");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb3).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
13
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("5.Who was the first and only female prime presidant of india" +sc);
rb1.setText("1.Meera Kumari");
rb2.setText("2.Pratibha (Tai) Patil");
rb3.setText("3.Sushma Swaraj ");
rb4.setText("4.Niramala Sitaraman");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb1).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("6.Which is the most selling car of 2022 in India till today");
rb1.setText("1.Maruti Suzuki Swift");
rb2.setText("2.Maruti Suzuki Boleno");
rb3.setText("3.MAruti Suzuki WagonR");
rb4.setText("4.Tata Nexon");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb2).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("7.2019 Bharat Ratna Award was Given to");
rb1.setText("1.Pranab Mukherjee");
rb2.setText("2.Bhupen Hazarika");
rb3.setText("3.Nanaji Deshmukh ");
rb4.setText("4.All of the above");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb3).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false); 14
q.setText("8.Most selling bike of 2022 till now in india");
rb1.setText("1.Hero HF-Deluxe");
rb2.setText("2.Honda Activa");
rb3.setText("3.Honda CB-Shine");
rb4.setText("4.Hero Splendor+");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb4).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("9.KGF stands for");
rb1.setText("1.Kollar gol field");
rb2.setText("2.Color Gold Field");
rb3.setText("3.Kollar Gold Field");
rb4.setText("4.Khalate's Gold Field");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb4).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
rb1.setChecked(false);
rb2.setChecked(false);
rb3.setChecked(false);
rb4.setChecked(false);
q.setText("10.Roll no of Bharat Khalate is ");
rb1.setText("1.42");
rb2.setText("2.{(x+y)-(b+c)}/2");
rb3.setText("3.86");
rb4.setText("4.010101010");
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb3).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{
if (rg.getCheckedRadioButtonId()== findViewById(R.id.rb3).getId())
{
sc++;
Toast.makeText(MainActivity.this, ""+sc, Toast.LENGTH_SHORT).show();
}
q.setText("CONGRATULATIONS YOU FINISHED THE QUIZ AND YOUR SCORE= "+sc+" \uD83E\uDD73\
uD83C\uDF89\uD83C\uDF8A");
q.setTextSize(50);
q.setGravity(Gravity.CENTER | Gravity.BOTTOM);
rb1.setVisibility(View.INVISIBLE);
rb1.setVisibility(View.INVISIBLE);
rb2.setVisibility(View.INVISIBLE); 15
rb3.setVisibility(View.INVISIBLE);
rb4.setVisibility(View.INVISIBLE);
btnn.setText("HOME !");
btnn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
{

q.setVisibility(View.INVISIBLE);
rb1.setVisibility(View.INVISIBLE);
rb1.setVisibility(View.INVISIBLE);
rb2.setVisibility(View.INVISIBLE);
rb3.setVisibility(View.INVISIBLE);
rb4.setVisibility(View.INVISIBLE);
btnn.setVisibility(View.INVISIBLE);
btns.setVisibility(View.VISIBLE);
h.setVisibility(View.VISIBLE);
btnn.setText("NEXT !");
sc=0;
}
}
});

}
}
});
}
}
});
}
}
});
}
}
});
}
}
});
}
}
});
}
}
});

}
}
});
}
}
});
}
}

});

}); 16
}

Output

Skill Developed
 WE learnt how to make Application in android
 WE learnt how to use Android studio
 WE learnt new programs concept in java and android
17
Area of future
 We will add new function and data to make it easier for operating.

 Faults will be removed if found any.

 As soon as possible we try to perform arithmetic operations on it

Conclusion
Hence from this Micro-Project we Learnt about how to write and compile program
And from this project we learnt different types of programming and their use in android
studio.

Reference
Srno. Reference Remark

1 tutorialspoint.com Website
2 YouTube: Some coding and programming YouTube
3 Different application Nirali,Techmax Pub.

18

You might also like