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 7549235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:53:59+00:00 2026-05-30T09:53:59+00:00

I am trying to develop a quiz app for physics, but I keep getting

  • 0

I am trying to develop a quiz app for physics, but I keep getting the error

02-23 16:02:06.006: E/Database(9348): on sqlite3_open_v2("data/data/com.mcq.srm/databases/q.db", &handle, 1, NULL) failed

Code Snippet below

public class QuestionPane extends Activity {
    int counter  =00;
    RadioButton radioButton;
    TextView Question;
    TextView tvScore;
    Button Next;

    SQLiteDatabase db;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.questionpane);

        int resdb=0;
        try {
            SQLiteDatabase checkDB = null;
             String DB_FULL_PATH = "data/data/com.mcq.srm/databases/q.db";
                checkDB = SQLiteDatabase.openDatabase(DB_FULL_PATH, null,
                        SQLiteDatabase.OPEN_READONLY);
                checkDB.close();
                //Toast.makeText(this,"db  "+checkDB, Toast.LENGTH_LONG).show();
                resdb=0;
                Log.v("msg","Database created");

        } catch (Exception e){
            resdb=1;    
        }
        Log.v("msg", "check res-->"+resdb);
        try{
        db = openOrCreateDatabase("q.db" , SQLiteDatabase.CREATE_IF_NECESSARY , null );
            if(resdb==1)
            {
                Log.v("msg","creating tables");
                CreateTable();
                InsertData();   
                displayres();
            }
        }
        catch(Exception e){
        }
    }

    public void CreateTable(){
        String Createtab;
          Createtab =" CREATE TABLE tbl_Question ("+ "_id INTEGER PRIMARY KEY AUTOINCREMENT, Questions TEXT, option_1 TEXT,option_2 TEXT, option_3 Text, option_4 TEXT, correct_answer TEXT);";
        try{
            db.execSQL(Createtab);

        }
        catch(Exception e){
        }   
  }
  public void InsertData(){
     ContentValues values = new ContentValues();

    values.put("question", "Two beams of red and violet colours are made to pass separately through a prism of A = 60°. In the minimum deviation position, the angle of refraction inside the prism will be");
    //... value.put statements removed
       db.insert("tbl_Question", null, values);

       //.. values.put statements removed
       values.put("correct_answer","35 grams");
       db.insert("tbl_Question", null, values);
   }
   public void displayres() {
            int qno=1;

            String sql1="select * from  question;";

            Cursor c1=db.rawQuery(sql1,null);
            Log.v("answer","asd");
              String que,opt1,opt2,opt3,opt4;

              startManagingCursor(c1);
              c1.moveToFirst();
              que=c1.getString(c1.getColumnIndex("Question1"));
              Log.v("answer",que);
        }
}
  • 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-05-30T09:54:00+00:00Added an answer on May 30, 2026 at 9:54 am

    There are lot of mistakes in your I’ll suggest you go through this example, it’s best to start with that example in android.You need to create separate class for Database generally know as Database Adapter and one more that is Database Helper by Android Devs. So to get complete idea go through that example.

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

Sidebar

Related Questions

I am trying to develop an application but I get this error whenever I
Im trying to develop my first ASP.NET MVC web app and have run into
I am trying to develop a .NET Web Project using NHibernate and Spring.NET, but
I am trying develop an Android app which uses Google maps. So for the
I am trying to develop a multi-screen app for the Google TV platform using
I have been trying to develop an app for my ipad which i can
I am trying to develop a Qt App using 4.7.3 which involves the writing
I am trying to develop a database model for a recruitment website and I
I am trying to develop a mobile app, that registered with a Java program
I'm trying to develop a Hybrid android app where all by logic to get

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.