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

  • SEARCH
  • Home
  • 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 9186763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:36:41+00:00 2026-06-17T19:36:41+00:00

My android app contains two table in a database where one table stores an

  • 0

My android app contains two table in a database where one table stores an dynamic data and another table should store nearly 7000 dictionary words into that table by parsing an text file.This action should be done one time when app installs first time.Text file is stored in raw folder.

The problem i am facing here is, when i try to parse and store into that table logcat say no such table in the database.

Here is the method and DBHelper snippet code:

DBHelper class snippet:

private static final String DICTIONARY_TABLE_CREATE =
"CREATE TABLE " + DATABASE_TABLE_NAME_DICTIONARY + "(" +
"_id INTEGER PRIMARY KEY AUTOINCREMENT,"+
"words TEXT NOT NULL);";

private static final String USER_TABLE_CREATE =
"CREATE TABLE " + DATABASE_TABLE_NAME_USERINFO + "(" +
"_id INTEGER PRIMARY KEY AUTOINCREMENT,"+
"player_name TEXT NOT NULL, " +
"player_username TEXT NOT NULL, " +
"player_pass TEXT NOT NULL, " +
"player_played VARCHAR NOT NULL, " +
"player_won VARCHAR NOT NULL, " +
"player_loss VARCHAR NOT NULL);";

public void onCreate(SQLiteDatabase db) 
{       
try
{
db.execSQL(USER_TABLE_CREATE);
db.execSQL(DICTIONARY_TABLE_CREATE);
System.out.println("In onCreate");
}
catch(Exception e)
{
e.printStackTrace();
}
}

Here is method to parse text file and insert values into database:

public void CopytxtfileTodb()
{
InputStream inputStream = getResources().openRawResource(R.raw.wordslists);
BufferedReader br = new BufferedReader( new InputStreamReader(inputStream));
SQLiteDatabase db = playerDB.getWritableDatabase();

try 
{                     
String line = ""; 

while((line= br.readLine()) != "")
{                                                 
ContentValues values = new ContentValues();

values.put("words", line);

try
{   
db.insert(DBHelper.DATABASE_TABLE_NAME_DICTIONARY, null, values);                                       
}                                                                  
catch(Exception e)
{
e.printStackTrace();

}                 
}              

} 
catch(Exception e) 
{ 
System.err.println("Parse Error: " + e.getMessage());                   
}               
  • 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-17T19:36:42+00:00Added an answer on June 17, 2026 at 7:36 pm

    The problem might be because DbHelper is not instantiated properly.Check if proper database name, version and context are passed during the instantiation of dbhelper.
    -Also can you tell me at which place in the code logcat complains about no database present
    -Attach your entire code rather than pieces

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

Sidebar

Related Questions

Two SQLite tables in my Android App: PoweredEquip which contains all powered equipment units
I've got a native Android app that contains a WebView. All my HTML, js
The android app reads from database but doesnt write anything to DB, the app
My android app leaks, what should I check? I gave a look at avoiding
My android app has a two word app name, and the 2nd word doesn't
I have an application that contains two Activities with <intent-filter> <action android:name=android.intent.action.MAIN/> <category android:name=android.intent.category.LAUNCHER/>
Let's say I have a website at example.com It contains two local views, Database
I got sqlite DB on my android app to save reservations. The one of
I have a native android app in which there are two activities, 1st activity
My app contains two classes: MainActivity, Activity2. Activity2 needs to access a non-static method

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.