Code example for SQLiteDatabase

Methods: isOpenquery

0
      mDatabase = SQLiteDatabase.openDatabase(path, null,
              SQLiteDatabase.NO_LOCALIZED_COLLATORS);
   } 
 
   public boolean validDatabase(){ 
      return (mDatabase == null)? false : mDatabase.isOpen();
   } 
 
   public Cursor getAyahTimings(int sura){
      if (!validDatabase()) return null; 
      return mDatabase.query(TimingsTable.TABLE_NAME,
              new String[]{ TimingsTable.COL_SURA,
                      TimingsTable.COL_AYAH, TimingsTable.COL_TIME },
              TimingsTable.COL_SURA + "=" + sura,
              null, null, null, TimingsTable.COL_AYAH + " ASC");
   } 
 
   public void closeDatabase() { 
      if (mDatabase != null){
         mDatabase.close();
         mDatabase = null;