Android App Project : Simple Quiz App (Android Studio + Java)

preview_player
Показать описание
Android App Project : Simple Quiz App (Android Studio + Java)

#androidproject #java #androidstudio #androidapp #rajjani

hey guys, last week i worked on simple quiz app development using android studio with java. So i recorded the basic app running app module. This will help you to develop simple quiz app. clear concept of providing data using custom array list. Used countdown timer to measure time of quiz. In this video i have recorded only basic working prototype of project. if you are developing quiz app it will give basic app but you have to put design and other stuff like fetching data from the server.

THANKS FOR WATCHING. LEAVE COMMENT IF YOU WANT ANY HELP IN THIS VIDEO.

LIKE, SHARE AND SUBSCRIBE

THANKS FOR YOUR SUPPORT.
Рекомендации по теме
Комментарии
Автор

Sir I'm struggling to create two timers on the same activity where the other one is automatically selected.

For example: I want to create sort of like a game to match this two timers (00:25:50) from this one (00:00:00) then if the player matches them he won.

Thanks in advance. (Anyone)

chosnpraise
Автор

Thank you for making this video, it's really helpful BRO! Keep it up!✌️

manthanvaghani
Автор

How bout giving color to selected button & save the color into list, when quizz have prev & next button, previous selected button load its color

hendri
Автор

Hello again




The clock does not reach zero


why?


Mucahs Thank you

marceloalejandro
Автор

Can u plz share the source code as I make through you video my app is getting crashed

neetumittal
Автор

Soon but when..?? Are you sure that you are gonna upload the link to the code here??

devdhee
Автор

heeeey, good video, can you share the source code?...

walterlopez
Автор

hello I have a problem


In the 25th minute the cursor waits.
Suddenly appears:


// init conter
conter = 0;


// load ques and ans
loadQuetions (conter);


How do you do it?


Because I get an error:


error: cannot find symbol variable conter




How do I fix it?


Thank you

marceloalejandro
Автор

Este es el código
Here is the code


package

import

import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import
import com.example.quizapp.R;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

//set controls
TextView tvQueConter, tvTimer, tvQue;

Button btopt1, btopt2, btopt3, btopt4;
int conter;

CountDownTimer tm;

//list for que
ArrayList<QuestionClass> queList = new ArrayList<>();

@Override
protected void onCreate(Bundle savedInstanceState) {



//find view by id
tvQue = findViewById(R.id.tvQue);
tvQueConter =
tvTimer = findViewById(R.id.tvTimer);

btopt1 = findViewById(R.id.btopt1);
btopt2 = findViewById(R.id.btopt2);
btopt3 = findViewById(R.id.btopt3);
btopt4 = findViewById(R.id.btopt4);

//load data
queList.add(new QuestionClass("This is dummy Que 1", "ans 1",
"ans 2", "ans 3", "ans 4", "ans 1"));
queList.add(new QuestionClass("This is dummy Que 1", "ans 1",
"ans 2", "ans 3", "ans 4", "ans 2"));
queList.add(new QuestionClass("This is dummy Que 1", "ans 1",
"ans 2", "ans 3", "ans 4", "ans 3"));

//init conter
conter = 0;

//load ques and ans
loadQuestions(conter);

tvTimer.setText("12");

//countdown time
tm = new CountDownTimer(12 * 1000, 1000){

@Override
public void onTick(long millisUntilFinished) {
tvTimer.setText("" + millisUntilFinished / 1000);

}

@Override
public void onFinish() {

Toast.makeText(MainActivity.this, "Quiz Over", Toast.LENGTH_LONG).show();

}
};

}
public void loadQuestions(int n){
final QuestionClass q = queList.get(n);

tvQueConter.setText((n + 1) + "/" + queList.size());

tvTimer.setText("" + 12);
if(tm != null){
tm.start();
}

tvQue.setText("#" + (n + 1) + " " + q.getQue());
btopt1.setText("" + q.getOpt1());
btopt2.setText("" + q.getOpt2());
btopt3.setText("" + q.getOpt3());
btopt4.setText("" + q.getOpt4());

//btn1
btopt1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if {
Toast.makeText(MainActivity.this, "Correct Answer", Toast.LENGTH_LONG).show();


if (conter < (queList.size() -1)){
tm.cancel();
conter++;
loadQuestions(conter);
}else{
Toast.makeText(MainActivity.this, "All Que Completed", Toast.LENGTH_LONG).show();
}

} else{
Toast.makeText(MainActivity.this, "Wrong Answerr", Toast.LENGTH_LONG).show();
}
}
});

//btn2
btopt2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if {
Toast.makeText(MainActivity.this, "Correct Answer", Toast.LENGTH_LONG).show();

if (conter < (queList.size() -1)){
tm.cancel();
conter++;
loadQuestions(conter);
}else{
Toast.makeText(MainActivity.this, "All Que Completed", Toast.LENGTH_LONG).show();
}
} else{
Toast.makeText(MainActivity.this, "Wrong Answerr", Toast.LENGTH_LONG).show();
}
}
});

//btn3
btopt3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if {
Toast.makeText(MainActivity.this, "Correct Answer", Toast.LENGTH_LONG).show();

if (conter < (queList.size() -1)){
tm.cancel();
conter++;
loadQuestions(conter);
}else{
Toast.makeText(MainActivity.this, "All Que Completed", Toast.LENGTH_LONG).show();
}
} else{
Toast.makeText(MainActivity.this, "Wrong Answerr", Toast.LENGTH_LONG).show();
}
}
});

//btn4
btopt4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if {
Toast.makeText(MainActivity.this, "Correct Answer", Toast.LENGTH_LONG).show();

if (conter < (queList.size() -1)){
tm.cancel();
conter++;
loadQuestions(conter);
}else{
Toast.makeText(MainActivity.this, "All Que Completed", Toast.LENGTH_LONG).show();
}
} else{
Toast.makeText(MainActivity.this, "Wrong Answerr", Toast.LENGTH_LONG).show();
}
}
});

}
}

juanej
Автор

can you please share the code ?many thanks

-tiktoktrend
visit shbcf.ru