Java Code Examples for android.database.sqlite.SQLiteDatabase.getPath()

The following are Jave code examples for showing how to use getPath() of the android.database.sqlite.SQLiteDatabase class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: YuiHatano   File: YuiCase.java   View Source Code Vote up 6 votes
@Override
protected void after() {
    if (DEBUG) {
        System.out.println("KBCase after");
    }
    Map<String, SQLiteDatabase> dbMap = mShadowContext.getDbMap();

    for (SQLiteDatabase db : dbMap.values()) {
        // 关闭数据库
        db.close();

        String dbPath = db.getPath();

        // 删除临时数据库文件
        new File(dbPath).delete();
    }

    dbMap.clear();

    deleteDbDir();
    deleteDir();
}
 
Example 2
Project: KBUnitTest   File: KBCase.java   View Source Code Vote up 6 votes
@Override
protected void after() {
    if (DEBUG) {
        System.out.println("KBCase after");
    }
    Map<String, SQLiteDatabase> dbMap = mShadowContext.getDbMap();

    for (SQLiteDatabase db : dbMap.values()) {
        // 关闭数据库
        db.close();

        String dbPath = db.getPath();
    }

    dbMap.clear();

    deleteTempDir();
}
 
Example 3
Project: TimeTrix   File: DatabaseAdapter.java   View Source Code Vote up 5 votes
public Boolean deleteDatabase() {
    SQLiteDatabase db = mDatabaseHelper.getWritableDatabase ();
    Boolean result = db.delete (DatabaseHelper.TABLE_NAME, null,
            null) != 0;
    db.getPath ();
    //Toast.makeText (mContext, "path = "+db.getPath (), Toast.LENGTH_SHORT).show ();
    //SQLiteDatabase.deleteDatabase (db.getPath ());
    File fileDataBase = new File (db.getPath ());
    SQLiteDatabase.deleteDatabase (fileDataBase);
    db.close ();
    return result;
}