Code example for BackupDataOutput

Methods: writeEntityDatawriteEntityHeader

0
        outWriter.writeUTF(mode);
        outWriter.writeLong(carID);
        // Send the data to the Backup Manager via the BackupDataOutput 
        byte[] buffer = bufStream.toByteArray();
        int len = buffer.length;
        data.writeEntityHeader(PREFS_HEADER, len);
        data.writeEntityData(buffer, len);
        bufStream.close();
        outWriter.close();
        } catch (IOException e) {
            Util.Error("MPGBackupAgent", "Error saving preferences: " + e.getMessage());
        } 
    } 
 
    private void doBackup( BackupDataOutput data, ParcelFileDescriptor newState) {
 
        DBHelper helper = new DBHelper(this);
        SQLiteDatabase db = helper.getReadableDatabase();
 
        // SELECT * FROM cars; used String[] for column names to know the column index 
Stop searching for code, let great code find you!  Add Codota to your java IDE