parse.com provide a way to save object in offline mode with object.saveEventually(); call.. this stores object in local dataStore unless the syncing done with server.
the problem is,I can not store file with below given lines
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 80, stream);
byte[] byteArray = stream.toByteArray();
file = new ParseFile("pic.png",byteArray);
object.put("file.png", file);
object.saveEventually();
it gives following error
java.lang.IllegalStateException: Unable to encode an unsaved ParseFile
according to parse documentation to save file file.saveInBackground should be called... and I think saveInBackground only works when there is internet connection...
but the thing which I want to implement is get data (object or file) from local dataStore until sync is done with server...
so how can I save file in such a way in offline mode that I can access that file from local dataStore until the sync is done with the server...