what is the best way of check existing database before creating new database on android -


i have created database android app contains static data , not require update/delete functionality when app starts, want check if db exists , if not execute dbadapter class. know simple if statement wondering efficient way query whether db exists.

use openorcreatedatabase method

public boolean checkdatabase(){      sqlitedatabase checkdb = null;      try{         string mypath = db_path + db_name;         checkdb = sqlitedatabase.opendatabase(mypath, null, sqlitedatabase.open_readonly | sqlitedatabase.no_localized_collators);      }catch(sqliteexception e){          //database does't exist yet.     }      if(checkdb != null){         checkdb.close();     }      return checkdb != null ? true : false; } 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -