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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:44:44+00:00 2026-05-31T17:44:44+00:00

Should I prepare a empty DB inadvance while using the SQliteOpenHelper to create db

  • 0

Should I prepare a empty DB inadvance while using the SQliteOpenHelper to create db tables ?
From the doc. of SQLiteOpenHelper, it states:

public abstract void onCreate (SQLiteDatabase db) 
Called when the database is created for the first time. This is where the creation of tables and the initial population of the tables should happen.

It makes me confused:
1. When the db will be created and to triger the onCreate() method ?
2. Does the db will be created automatically if it is not existed ?

Thanks for the reviewing the question and help reponse !

  • 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-31T17:44:45+00:00Added an answer on May 31, 2026 at 5:44 pm

    The onCreate() method will be invoked and the DB will be created when it is not found on the phone’s storage.

    If the DB exists but with an older version you’ll get a call to onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)

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

Sidebar

Related Questions

Should I still be using tables anyway? The table code I'd be replacing is:
I am using PHP to read a text field (DESCRIPTION) from MYSQL and prepare
Should I prepare my code for possible/predicted future changes so that it's easier to
How should I prepare the code if it something fails? With try-catch statement or?
Should developers avoid using continue in C# or its equivalent in other languages to
I have a query that should request the top X number of records using
While trying to zip an archive using the java.util.zip I ran into a lot
Possible Duplicate: What should we do to prepare for 2038? What is year 2038
I need to prepare a blue print. It should be a video. A small
I have two functions: void prepare() and void finish() that will be called sequentially

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.