When I use android/com.android.internal.backup.LocalTransport
I have no problems to store images (byte
[]) along with other text data.
When I try to uninstall and install dev app on a device I see blank images and the following error SkImageDecoder::Factory returned null error
The way I store an image file in JSON:
File file = new File(filesDir, pictureFilename);
jsonObject.put("pictureFile", file.toString().getBytes());
And that's how I restore them:
try {
FileOutputStream out = new FileOutputStream(file);
out.write(jsonObject.get("pictureFile").toString().getBytes());
out.close();
} catch (Exception e) {
Log.e(TAG, "Can not write pictureFile", e);
}
UPD. My BackupAgent