Code Monkey home page Code Monkey logo

code-challenge's Introduction

code-challenge

App Design / Choices

When users open the trivia app, they will see the Welcome message on the top, followed by the first question.
Since the app has a series of ture/false questions, each question has two choices to choose from, either True or False.
When a choice is made, users then click the Confirm button to submit the answer.
If there is no answer selected, a message is displayed to inform the user to select an answer.
If there is an answer is selected, it will let the user know if the selected answer is correct.
And the user are not able to redo the question.
Users can swipe right to the next question, or swipe left to the previous question.

Object Oriented Analysis and Design

MainActity: LinearLayout, ViewPager. ViewPager single row components

  1. TextView: displays the welcome message, visible when the ViewPager position is 0, invisible otherwise.
  2. TextView: displays the question
  3. RadioGroup RadioButton: True RadioButton: False Button: to check the answer TextView: displays whether the selected answer is correct or wrong You can swipe right to the next position of the ViewPager, and swipe left to the previous position of the ViewPager. Data model class: constructor, getters setters for the API response. Restful API: Volley is used to get the API response. When the button is clicked, it checks if a RadioButton is clicked, if not it displays a Toast, and you have to select a RadioButton.
    Click the button again, it will save either "Ture" or "False" to a String called answer based on the RadioButton selected, and compare with the correct_answer we get from the API response.
    If there is a match, TextView displays "Correct", if not, the TextView displays "Wrong".
    The RadioButtons and Button are then disabled.
    The ViewPager goes to the next position after a 5 second delay.

Local environment setup instructions

The app is written in Java in Android Atudio.
Android Studio is needed to run the app.
The minSdkVersion is 24.
An emulator or Android phone running Android 7.0 Nugget or above is required to run the app.

code-challenge's People

Contributors

harry520 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.