title: Open downloaded SQLite Database
body: <p>I have a pre-made SQLite database that I am downloading from the net via an AsyncTask. It downloads the file and stores it on the sdcard in /data/databases/ I have checked the database file and it is successfully downloading and has all the appropriate tables and data but every time I try and open the database and display the stored data I get the following</p>
  
  <pre><code>    03-19 18:43:10.204: E/AndroidRuntime(3057): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ondrovic.downloader/com.ondrovic.downloader.Main}: android.database.sqlite.SQLiteException: no such table: beers: , while compiling: SELECT * FROM beers ORDER BY _id
  </code></pre>
  
  <p>which makes no sense because the table is there</p>
  
  <p>maybe my databasehelper class is wrong or I am calling it wrong.</p>
  
  <p>here is my database.java</p>
  
  <pre><code>   package com.ondrovic.downloader;
  
     import java.io.File;
  
     import android.content.Context;
     import android.database.sqlite.SQLiteDatabase;
     import android.database.sqlite.SQLiteOpenHelper;
     import android.os.Environment;
  
     public class Database extends SQLiteOpenHelper{
  //File rDIR = Environment.getExternalStorageDirectory();
  private static String DBPATH = "/data/databases/BOOMBOZZ/";
  private static String DBNAME = "boombozz.db";
  private static int DBVER = 1;
  
  private SQLiteDatabase db;
  private final Context dbContext;
  
  public Database(Context context) {
      super(context, DBNAME, null, DBVER);
      this.dbContext = context;
  }
  
  public void open() {
      String myPath = DBPATH + DBNAME;
      db = SQLiteDatabase.openDatabase(Environment.getExternalStorageDirectory() + myPath, null, SQLiteDatabase.OPEN_READWRITE);
  }
  
  public synchronized void close() {
  
      db.close();
      super.close();
  }
  
  @Override
  public void onCreate(SQLiteDatabase db) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
      // TODO Auto-generated method stub
  
     }
  }
  </code></pre>
  
  <p>And here is where I am calling it in my main class</p>
  
  <pre><code> db = (new Database(this)).getWritableDatabase();
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>Thanks</p>