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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:49:35+00:00 2026-05-16T04:49:35+00:00

I created a sqlite database to store playlists for a media player I am

  • 0

I created a sqlite database to store playlists for a media player I am developing because of extended feature (rather than using the Content Provider). It works perfectly on the 1.6 emulator but FCs on anything higher than 2.0… what has changed that I need to know about as far as opening databases in SDK 2.0+? Here is the logcat.

08-06 19:05:46.365: INFO/SQLiteDatabaseAdapter(4692): DB (playlists.db) copied!
08-06 19:05:46.373: INFO/SQLiteDatabaseAdapter(4692): Try to create instance of database (playlists.db)
08-06 19:05:46.373: INFO/SQLiteDatabaseAdapter(4692): Create or Open database : playlists.db
08-06 19:05:46.389: INFO/SQLiteDatabaseAdapter(4692): instance of database (playlists.db) created !
08-06 19:05:46.389: INFO/Database(4692): sqlite returned: error code = 1, msg = no such table: playlist
08-06 19:05:46.397: DEBUG/AndroidRuntime(4692): Shutting down VM
08-06 19:05:46.397: WARN/dalvikvm(4692): threadid=1: thread exiting with uncaught exception (group=0x4001d7e0)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): FATAL EXCEPTION: main
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidworkz.andamp/com.androidworkz.andamp.andAMP}: android.database.sqlite.SQLiteException: no such table: playlist: , while compiling: SELECT playlist.* FROM playlist ORDER BY id ASC;
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.os.Handler.dispatchMessage(Handler.java:99)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.os.Looper.loop(Looper.java:123)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at java.lang.reflect.Method.invokeNative(Native Method)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at java.lang.reflect.Method.invoke(Method.java:521)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at dalvik.system.NativeStart.main(Native Method)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): Caused by: android.database.sqlite.SQLiteException: no such table: playlist: , while compiling: SELECT playlist.* FROM playlist ORDER BY id ASC;
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:64)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:80)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:46)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at com.androidworkz.andamp.objects.Playlist.getPlaylists(Playlist.java:75)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at com.androidworkz.andamp.andAMP.onCreate(andAMP.java:353)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-06 19:05:46.514: ERROR/AndroidRuntime(4692): … 11 more

Here is the dbhelper class

package com.androidworkz.andamp;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {

// Android's default system path for your application's database.
private static String DB_PATH = "/data/data/com.androidworkz.andamp/databases/";

private static String DB_NAME = "playlists.db";

public DBHelper(Context context) {

    super(context, DB_NAME, null, 1);
    if (!checkDataBaseExistence()) {
        createDatabase();
    }
}

public void onCreate(SQLiteDatabase db) {
    // Leave this method empty
}

public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    // fill in your code here
}

public void createDatabase() {

    SQLiteDatabase db = null;
    String dbPath = DB_PATH + DB_NAME;
    db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.CREATE_IF_NECESSARY);
    db.close();

    db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);

    db.execSQL("CREATE TABLE  ("+
            "[id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,"+
            "[name] VARCHAR(255)  NULL);)");

    db.execSQL("CREATE TABLE [songs] ("+
            "[id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,"+
            "[playlistId] INTEGER  NULL,"+
            "[songId] INTEGER  NULL,"+
            "[name] VARCHAR(255)  NULL,"+
            "[key] VARCHAR(255)  NULL,"+
            "[duration] INTEGER  NULL,"+
            "[path] VARCHAR(255)  NULL,"+
            "[artistName] VARCHAR(255)  NULL,"+
            "[artistKey] VARCHAR(255)  NULL,"+
            "[albumId] INTEGER  NULL,"+
            "[albumName] VARCHAR(255)  NULL,"+
            "[albumKey] VARCHAR(255)  NULL);");
    db.close();
}

private boolean checkDataBaseExistence() {

    // database to be verified
    SQLiteDatabase dbToBeVerified = null;

    try {
        // get database path
        String dbPath = DB_PATH + DB_NAME;
        // try to open the database
        dbToBeVerified = SQLiteDatabase.openDatabase(dbPath, null,
                SQLiteDatabase.OPEN_READONLY);

    } catch (SQLiteException e) {
        // do nothing since the database does not exist
    }

    // in case it exists, close it
    if (dbToBeVerified != null) {
        // close DB
        dbToBeVerified.close();

    }

    // in case there is a DB entity, the DB exists
    return dbToBeVerified != null ? true : false;
}
}

god I hate this stupid “enter code here”… why can’t stackoverflow just use tags like a normal syntax highlighter.

  • 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-16T04:49:36+00:00Added an answer on May 16, 2026 at 4:49 am

    08-06 19:05:46.389: INFO/Database(4692): sqlite returned: error code = 1, msg = no such table: playlist

    Are you sure the database is copying correctly, it appears as though the table doesn’t exist?

    Have you tried copying the data off the phone after execution via DDMS and exploring it to see if the schema is correct?

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

Sidebar

Related Questions

I am new to using the SQLite database in iphone apps. I have created
I'm using a SQLite database to store information on players and their teams using
I am using a SQLite database to store values from a data logger. The
Possible Duplicate: Where does Android emulator store SQLite database? I am using SQLite and
I am trying to store data in created SQLite database. Here is the code
I am using the SQLite database to store data in my application. Can the
I am using an SQLITE database to store latitudes and longitudes of locations. I
I need some help to store a Object in an SQLite database using Android.I
I'm using ORMlite to store the date in sqlite in android. I've created a
where do the tables created using SQlite database will be stored in Android? how

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.