Code example for ContentValues

Methods: put

0
    public void close() { 
        mDB.close();
    } 
 
    public boolean putFileForLater(String filepath, String account, String message) {
        ContentValues cv = new ContentValues();
        cv.put("path", filepath);
        cv.put("account", account);
        cv.put("attempt", UPLOAD_STATUS_UPLOAD_LATER);
        cv.put("message", message);
        long result = mDB.insert(TABLE_INSTANT_UPLOAD, null, cv);
        Log.d(TABLE_INSTANT_UPLOAD, "putFileForLater returns with: " + result + " for file: " + filepath);
        return result != -1;
    } 
 
    public int updateFileState(String filepath, Integer status, String message) {
        ContentValues cv = new ContentValues();
        cv.put("attempt", status);
        cv.put("message", message);
        int result = mDB.update(TABLE_INSTANT_UPLOAD, cv, "path=?", new String[] { filepath });
        Log.d(TABLE_INSTANT_UPLOAD, "updateFileState returns with: " + result + " for file: " + filepath);