Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8836723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:33:37+00:00 2026-06-14T09:33:37+00:00

I have a quiz app which populates a sqlite database with questions of around

  • 0

I have a quiz app which populates a sqlite database with questions of around 20 different categories. I want to implement in app billing so that if someone purchases Category1 for example, then these questions are added to the database and no others. Some of my questions fall within two categories so let’s say Category1 and Category2.

try {
            for (int n = 1; n < sqlString.length; n++) {

                db.execSQL("INSERT INTO " + DATABASE_TABLE + " VALUES ("
                        + sqlString[n] + ");");

            }
            db.setTransactionSuccessful();
        } finally {
            db.endTransaction();
        }

This is my current set up in the SQLite class onCreate method. sqlString is a string array containing all my 500 questions so far.

I’m going to store whether a category has been bought in another table (but I am open to other suggestions on how to do this). I plan on creating a class which reads this database setting up boolean values of true or false whether each category has been bought. So

boolean cat1 = CheckIfCategoryHasBeenBought(category1)

etc. Then if it has been bought I will implement a method such as

boolean[] catChecker = {cat1, cat2, cat3, etc....}
SQLite info = new SQLite(this);
info.open();
info.addQs(catChecker)
//this will pass the true and false boolean values for each method then 
//based on that I choose to implement or not
info.close();

However I don’t know if this is even a good way to do it. I’m not sure how to check if the value has already been added (as a result of it crossing over with another category that’s been bought). I was thinking a cursor would be best to check if the value is already added however how do I get the cursor to search?

The ways I’ve thought this could be achieved is

1) I create a string array only with the strings associated with bought questions.
2) I create an if statement within the for loop above which checks whether the string is from a bought category
3) I give the value “null” to all strings that haven’t been bought then add an if statement only executing the SQL if the sqlString[n] is not null.

Do you guys have any idea how it would be best to set this up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:33:38+00:00Added an answer on June 14, 2026 at 9:33 am

    Have you thought about starting with a full database – i.e. containing all questions that could be purchased by anyone – and then delete those that are no longer applicable?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a quiz app which emails the user the results. I want
I've created Yii quiz module which I also want to use in Facebook app
A little background for my app. I have users that have 1 quiz and
I am making a quiz app and want it to have a 'witty remark'
I have a quiz app which has a timer for the whole gameactivity where
I am making a quiz app and i have set different background music in
i have this app that asks the user to take a quiz and after
I have a quiz app with many categories: Category 1 List item 1 List
For a quiz app, I have a class that stores data in arrays that
I am writing a jquery phonegap quiz app and have a number of categories

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.