Proyecto de aplicación de Android: aplicación simple Quiz (Android Studio + Java)



Proyecto de aplicación de Android: aplicación simple Quiz (Android Studio + Java)

#androidproject #java #androidstudio #androidapp #rajjani
Hola chicos, la semana pasada trabajé en el desarrollo de aplicaciones para pruebas usando Android Studio con Java. Así que registré la aplicación básica que ejecuta el módulo de la aplicación. Esto te ayudará a desarrollar una aplicación de prueba simple. concepto claro de provisión de datos a través de una lista de matriz personalizada. Usó el temporizador de cuenta regresiva para medir el tiempo de la prueba. En este video grabé solo un prototipo de trabajo básico del proyecto. Si está desarrollando una aplicación de prueba, proporcionará una aplicación básica, pero debe colocar el diseño y otras cosas como recuperar datos del servidor.

GRACIAS POR VER. DEJA UN COMENTARIO SI QUIERES AYUDA EN ESTE VIDEO.

CÓMO COMPARTIR Y UNIRSE

GRACIAS POR TU APOYO. .

Compruebe también

Батарея БЫСТРО Садиться на Телефоне ? ДЕЛАЙ ТАК

#shorts 🔥 Мой Instagram: TikTok: 🔥 Мой Телеграм канал ” Androhack ” с Играми тут …

12 comentarios

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

  2. u can't speak

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

  4. Where to look is the score obtained.

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

  6. Este es el código
    Here is the code

    package com.example.quizapp.Activity;

    import androidx.appcompat.app.AppCompatActivity;

    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 com.example.quizapp.ModelClass.QuestionClass;

    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) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    //find view by id

    tvQue = findViewById(R.id.tvQue);

    tvQueConter = findViewById(R.id.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 (btopt1.getText().equals(q.getRightopt())) {

    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 (btopt2.getText().equals(q.getRightopt())) {

    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 (btopt3.getText().equals(q.getRightopt())) {

    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 (btopt4.getText().equals(q.getRightopt())) {

    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();

    }

    }

    });

    }

    }

  7. Source code???

  8. Hello again

    The clock does not reach zero

    why?

    Mucahs Thank you

  9. 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

  10. can you please share the code ?many thanks

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

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *