Trivia Quiz App for Android

* * * * (41 ratings)
Trivia Quiz App for Android | App Code for Sale | Hero
Trivia Quiz App for Android | App Code for Sale | Hero



‘Quiz App’ is a native Android template app for quality trivia. This project is easy to use and configure over property list (XML), so there is no need that you know programming.

You can define as many quiz topics as you like, each quiz have unlimited number of questions, for each question there are 4 possible answers and between them you have to define correct answer.

When user select quiz, gameplay screen appears and user have to pick correct answer in 5 seconds. Time is represented visually as 5 lines that will turn to gray when each second pass and they'll change color from green to red depending how much seconds is left. Game also support configurable score system. Application has categories of different quizzes which feature questions from each quiz.

This module has three packages with their set of classes. Main package has all activities while utility classes have a separate package. Then there is package for Twitter classes.

Quizzes Class

Quizzes class holds different categories of quizzes. Each category has questions specific to each quiz. List of categories are shown through listview control and populated with its adapter.

listOfQuizzes = PListHelper.parseQuizzesPlist(PListHelper.readQuizzesListFromAssets(getApplicationContext()));

        if(listOfQuizzes != null)
            listView.setAdapter(new QuizzesListAdapter(Quizzes.this, listOfQuizzes));

Selection of any category results in start of game implemented by class PlayGame.

public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {     
        if(listOfQuizzes != null){
            Intent aQuizIntent = new Intent(Quizzes.this, PlayGame.class);
            Utils.quiz = listOfQuizzes.get(position);

Each quiz-item view in listview is generated by returning getView against each item.

public View getView(int position, View convertView, ViewGroup parent) {
            Log.i("QuizzesPage", "QuizzesListAdapter: getView");
            View view = null;
            if(convertView == null){
                view = LayoutInflater.from(context).inflate(R.layout.row, null);
                final ViewHolder viewHolder = new ViewHolder();
       = (TextView)view.findViewById(;
                viewHolder.description = (TextView)view.findViewById(;
                viewHolder.imageName = (ImageView)view.findViewById(;

                view = convertView;             
            ViewHolder holder = (ViewHolder)view.getTag();


            //menu item image
            String imageName = _listOfQuizzes.get(position).getImageName();
            if(imageName != null){
                AssetManager assetManager = getAssets();
                try {
                    InputStream inputStream ="images/"+imageName);
                } catch (IOException e) {

            return view;

PlayGame Class

PlayGame class covers the main logic of the game. Each quiz question is selected randomly and displayed by GenerateQuestionNumber and PopulateQuestion functions respectively.

//Generate Random Game Question Number
    private int GenerateQuestionNumber(){
        Random rand = new Random();
        int temp = -1;
        boolean test;
            temp = rand.nextInt(totalQuestions);
            test = myListOfTriviaQuestions.get(temp).GetIsThisQuestionAsked();
        }while(test && questionsAsked < totalQuestions);    //skip while new

        return temp;//return currentQuestionNumber+=1;

//Populate UI controls with trivia game questions
    private void PopulateQuestion() {       
        if(questionsAsked<=myListOfTriviaQuestions.size()){ //true until last question
            questionNumber.setText("question " + questionsAsked);
        }else{  //game complete


SecondCountDownRunner is a custom runnable class to send timer message after each second to update game state.

private class SecondCountDownRunner implements Runnable{
        private boolean doRun = true;       

        public void run() {

            while( doRun && !Thread.currentThread().isInterrupted()){
                Message m = new Message();
                m.what = PlayGame.SECONDPASSEDIDENTIFIER;   //unique message code
                try {
                } catch (InterruptedException e) {


        //To stop timer
        public void stopThread(){

        //To resume timer
        public void resumeThread(){

        public void startThread(){

myTimerViewUpdateHandler class does handle message from above runnable to perform desired state change of the game.
Handler myTimerViewUpdateHandler = new Handler(){

        public void handleMessage(Message msg) {
                case PlayGame.SECONDPASSEDIDENTIFIER:
                    if(mySecondsPassed > 0)
                        mySecondsPassed -= 1;
                    else {
                        mySecondsPassed = config.GetTimeToAnswer();
                        if(questionsAsked >= totalQuestions){   //true when all questions asked
                        else {



Result Class

Result class simply displays results the statistics received from PlayGame class.

Intent resultReview = getIntent();      
        totalPoints = resultReview.getExtras().getInt("Points");
        title = resultReview.getStringExtra("Title");

        prefs = PreferenceManager.getDefaultSharedPreferences(this);

        highScore = prefs.getInt(title + "HS", -1);

        if(highScore == -1){
            SharedPreferences.Editor prefsEditor = prefs.edit();
            prefsEditor.putInt(title + "HS", totalPoints);

            txtYourScore.setText("With " + totalPoints + " points you have set an new High score!");
            if(highScore > totalPoints){
                txtHighScore.setText("Highscore: " + highScore);
                txtYourScore.setText("You have scored " + totalPoints + " points.");
                SharedPreferences.Editor prefsEditor = prefs.edit();
                prefsEditor.putInt(title + "HS", totalPoints);

                txtYourScore.setText("With " + totalPoints + " points you have set an new High score!");

P-list Configuration:

Project includes quizzeslist.plist file that stores data about annotations. Each <quiz/> item defines one quiz in collection of quizzes. Each quiz has a name, description, imageName and list of questions with their answers. Questions has array of <question/> child items. Each <question/> item has a question, array of options and an answer. These are the annotations taken from plist file:

• Name – of quiz • Description – about quiz • ImageName – of the quiz logo • Questions – in a quiz. • Question – in a quiz. • Options – in a question • Answer – of a question

<plist version="1.0">
        <string>Check your knowledge about great historical events, who did what where to whom!</string>
                <string>Which book is NOT part of the Standard Works?</string>
                    <string>The Book of Mormon</string>
                    <string>Lectures on Faith</string>
                    <string>Doctrine and Covenants</string>
                <string>Who is NOT a member of the God-head?</string>
                    <string>Joseph Smith</string>
                    <string>Jesus Christ</string>
                    <string>The Holy Ghost</string>
                    <string>Heavenly Father</string>
                <string>The First Vision took place in which year?</string>
22 Comments Leave a comment


Please login in order to leave a comment.

Newest first
  • um. this app doesn't suck because the questions come off the net like smiling cat says.

    I do agree that the documentation is not good, but it's the best app ive found as far as clean code.

    Yeah I know how to get the ssl working. You just get a server and get the ssl working.

    Dropbox isn't gonna do it. If you're going to build apps, I assume you would have access to your own server.

    My complaint is that it doesn't come with any ad managers built in.

    BUt then again, the other apps I have make it difficult to change the ads around and tey're getting paid when you're using the app until you change the data!

    and sometimes it's hidden.

  • smilingcat Buyer 2014-03-04 16:35:34 Thread #14725

    Note to future buyers: only buy this if you really know your way around Android Apps. Horrible Documentation and as it seems zero developer support through the comments area.

    It seems that you must upload your quiz questions to a server as they are loaded dynamically from the app. The original quiz plist resides here: So if you want your own questions loaded, create a public Drop Box folder and paste the URL into the config.plist. However, as it seems, the connection to the URL is not encrypted so that pretty much anyone can figure out where your questions are and steal them from you.

    Has anyone figured out how to either secure the questions or load them locally from the device?

  • bil.kimes 2014-02-24 17:27:11 Thread #13770

    All of the code displayed on this site should be prefaced by BUYER BEWARE. I own the iOS version of this license and I can agree with all comments the state that HupaMobile and the developer of this App DO NOT RESPOND. THE DO A PITIFUL JOB WITH SUPPORT. However I can say that this App works very well once you get it running.

  • sweed73 Buyer 2013-12-24 16:48:41 Thread #8847

    Just bought this app and should have read the comments first. Has anyone had any success in getting it working with their own questions?

  • ksbarot 2013-12-05 05:27:53 Thread #7923

    i want to purchase it but many remarks show that developer is not responsive???

  • EugeneN Buyer 2013-10-10 13:03:15 Thread #5698

    not for beginners, need to study no support,no reply from customer support

    downloaded file has bug...documentation not helpful

  • thomas.m.slezak Buyer 2013-09-24 23:21:52 Thread #5172

    The questions won't change when I change them in the quizzeslist.

  • kanyaugatiejagwo 2013-09-17 01:00:27 Thread #4908

    Purchased the app and it failed to download.

  • EugeneN Buyer 2013-08-31 15:13:39 Thread #4466

    how to contact support for this app? have some questions not in document

    i tried to mail "support @ chupamobile .com" but not reply?

  • Cristi Buyer 2013-08-13 06:45:38 Thread #3915

    Bought the app last week. Learned. Except the Twitter thing, it works. I have some very little customizations to make (in fact, three little pigs to eliminate) - and I’ll pay for that. It is not big deal, of course - but is easy money. Could the developer contact me? Thanks, Christian Pitner

to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.