public boolean backup ( SQLiteDatabase db , Context ctx , String suffix ) { try { new CsvTableWriter ( this ) . dumpToCsv ( ctx , db , suffix ) ; } catch ( SQLException e ) { if ( e . getMessage ( ) . contains ( "no such table" ) ) { Log . w ( TAG , "Table " + this . getTableName ( ) + " doesn't exist. This is expected if the table is new in this db version." ) ; } } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; return false ; } return true ; }
Backs up the current table to a CSV file .