IT. Expert System.

Android Reference

FullBackupAgent


android.app.backup

Class FullBackupAgent



  • public class FullBackupAgent
    extends BackupAgent
    Simple concrete class that merely provides the default BackupAgent full backup/restore implementations for applications that do not supply their own.
    • Constructor Detail

      • FullBackupAgent

        public FullBackupAgent()
    • Method Detail

      • onBackup

        public void onBackup(ParcelFileDescriptor oldState,
                    BackupDataOutput data,
                    ParcelFileDescriptor newState)
                      throws IOException
        Description copied from class: BackupAgent
        The application is being asked to write any data changed since the last time it performed a backup operation. The state data recorded during the last backup pass is provided in the oldState file descriptor. If oldState is null, no old state is available and the application should perform a full backup. In both cases, a representation of the final backup state after this pass should be written to the file pointed to by the file descriptor wrapped in newState.

        Each entity written to the BackupDataOutput data stream will be transmitted over the current backup transport and stored in the remote data set under the key supplied as part of the entity. Writing an entity with a negative data size instructs the transport to delete whatever entity currently exists under that key from the remote data set.

        Specified by:
        onBackup in class BackupAgent
        Parameters:
        oldState - An open, read-only ParcelFileDescriptor pointing to the last backup state provided by the application. May be null, in which case no prior state is being provided and the application should perform a full backup.
        data - A structured wrapper around an open, read/write file descriptor pointing to the backup data destination. Typically the application will use backup helper classes to write to this file.
        newState - An open, read/write ParcelFileDescriptor pointing to an empty file. The application should record the final backup state here after writing the requested data to the data output stream.
        Throws:
        IOException
      • onRestore

        public void onRestore(BackupDataInput data,
                     int appVersionCode,
                     ParcelFileDescriptor newState)
                       throws IOException
        Description copied from class: BackupAgent
        The application is being restored from backup and should replace any existing data with the contents of the backup. The backup data is provided through the data parameter. Once the restore is finished, the application should write a representation of the final state to the newState file descriptor.

        The application is responsible for properly erasing its old data and replacing it with the data supplied to this method. No "clear user data" operation will be performed automatically by the operating system. The exception to this is in the case of a failed restore attempt: if onRestore() throws an exception, the OS will assume that the application's data may now be in an incoherent state, and will clear it before proceeding.

        Specified by:
        onRestore in class BackupAgent
        Parameters:
        data - A structured wrapper around an open, read-only file descriptor pointing to a full snapshot of the application's data. The application should consume every entity represented in this data stream.
        appVersionCode - The value of the android:versionCode manifest attribute, from the application that backed up this particular data set. This makes it possible for an application's agent to distinguish among any possible older data versions when asked to perform the restore operation.
        newState - An open, read/write ParcelFileDescriptor pointing to an empty file. The application should record the final backup state here after restoring its data from the data stream. When a full-backup dataset is being restored, this will be null.
        Throws:
        IOException


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 310 / 158860914. Delta: 0.08397 с