checking database in android -


i have check whether database exists or not in android?? how can check? should return boolean value after checking?plz provide me code.

something like:

private boolean databaseexists() {     sqlitedatabase checkdb = null;     try {         string mypath = db_path + database_name;         checkdb = sqlitedatabase.opendatabase(mypath, null,             sqlitedatabase.open_readonly);         if(checkdb != null){             checkdb.close();             return true;         } else {             //database not exist             return false;         }     } catch (sqliteexception e) {         //database not exist         return false;     } } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -