BackupDataInputStream getKey - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for BackupDataInputStream getKey method.

This code example shows how to use the following methods:getKey, read, size
     * @see android.app.backup.BackupHelper#restoreEntity(android.app.backup. 
     * BackupDataInputStream) 
     */ 
    @Override 
    public void restoreEntity(BackupDataInputStream data) {
        if (ACCOUNTS_BACKUP_KEY.equalsIgnoreCase(data.getKey())) {
            try { 
                String profilesStr = readData(data);
                JSONArray accounts = new JSONArray(profilesStr);
                if (accounts != null && accounts.length() > 0) {
                    SipProfileJson.restoreSipAccounts(mContext, accounts);
                } 
            } catch (IOException e) {
                Log.e(THIS_FILE, "Cannot restore backup entry", e);
            } catch (JSONException e) {
                Log.e(THIS_FILE, "Cannot parse backup entry", e);
            } 
        } 
    } 
 

5
CodeRank
This code example shows how to use the following methods:getKey, size
    /** 
     * Restores one entity from the restore data stream to its proper shared 
     * preferences file store. 
     */ 
    public void restoreEntity(BackupDataInputStream data) {
        String key = data.getKey();
        Log.i(TAG, "-------------------------------------------------");
        Log.i(TAG, "--- restore Entity '" + key + "' size=" + data.size());
        super.restoreEntity(data);
        Log.i(TAG, "----- restoreEntity End");
        Log.i(TAG, "-------------------------------------------------");
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:getKey, size
    /** 
     * Restores one entity from the restore data stream to its proper shared 
     * preferences file store. 
     */ 
    public void restoreEntity(BackupDataInputStream data) {
        String key = data.getKey();
        Log.i(TAG, "-------------------------------------------------");
        Log.i(TAG, "--- restore Entity '" + key + "' size=" + data.size());
        super.restoreEntity(data);
        Log.i(TAG, "----- restoreEntity End");
        Log.i(TAG, "-------------------------------------------------");
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:getKey, size
    /** 
     * Restores one entity from the restore data stream to its proper shared 
     * preferences file store. 
     */ 
    public void restoreEntity(BackupDataInputStream data) {
        String key = data.getKey();
        Log.i(TAG, "-------------------------------------------------");
        Log.i(TAG, "--- restore Entity '" + key + "' size=" + data.size());
        super.restoreEntity(data);
        Log.i(TAG, "----- restoreEntity End");
        Log.i(TAG, "-------------------------------------------------");
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:getKey, size
    // Restore 
    // =========================================================== 
 
    @Override 
    public void restoreEntity(BackupDataInputStream data) {
        String key = data.getKey();
        Log.i(TAG, "-------------------------------------------------");
        Log.i(TAG, "--- restore Entity '" + key + "' size=" + data.size());
 
        if (backupKey.equals(key)) {
            readBackup(data);
        } 
        Log.i(TAG, "----- restoreEntity End");
        Log.i(TAG, "-------------------------------------------------");
    } 
 
    public void readBackup(InputStream data) {
        Log.d(TAG, "read Backup : " + data);
        try { 
            JsonFactory f = new JsonFactory();
4
CodeRank
getKey Method Overview
Report the key string associated with this entity within the backup data set.
See Code Examples for other Android BackupDataInputStream Methods: