title: cannot open file + Android
body: <p>I've downloaded source code from <a href="http://code.google.com/p/picview-for-android/" rel="nofollow">http://code.google.com/p/picview-for-android/</a> and trying to run it in Eclipse. But LogCat shows </p>
  
  <pre><code>External Storage: /mnt/sdcard
  
  DB Path: /mnt/sdcard/data/picview/accounts_followed.db
  
  (14) cannot open file at line 30174 of [00bb9c9ce4]
  
  (14) os_unix.c:30174: (13) open(/mnt/sdcard/data/picview/accounts_followed.db) - 
  Failed to open database '/mnt/sdcard/data/picview/accounts_followed.db'.
  
  android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14):      Could not open database
  </code></pre>
  
  <p>....
  ....
  ....</p>
  
  <p>AbstractPicViewDatabase.java contains the following code. I think, the problem lies somewhere in this class only. Please Help.</p>
  
  <pre><code>protected static SQLiteDatabase getUsableDataBase(String dbName, String sqlCreateQuery) {
  File dbFile = getPathToDb(dbName);
  
  File fileDirectory = new File(dbFile.getParent());
  if (!fileDirectory.exists()) {
  // Make sure the path for the file exists, before creating the
  // database.
  fileDirectory.mkdirs();
  }
  Log.d(TAG, "DB Path: " + dbFile.getAbsolutePath());
  boolean initDb = !dbFile.exists();
  try {
  SQLiteDatabase result = SQLiteDatabase.openOrCreateDatabase(dbFile, null);
  
  if (initDb) {
  
  result.execSQL(sqlCreateQuery);
  }
  
  return result;
  } catch (SQLiteException ex) {
  Log.w(TAG, "Could not open or image database.");
  return null;
  }
  }
  
  /**
  * Returns a file for the data base with the given name.
  */
  protected static File getPathToDb(String dbName) {
  String sdCardPath = Environment.getExternalStorageDirectory()
          .getAbsolutePath();
  Log.d(TAG, "External Storage: " + sdCardPath);
  return new File(sdCardPath + File.separator + "data" + File.separator
          + PicViewConfig.APP_NAME_PATH + File.separator + dbName);
  }
  </code></pre>