rafi0101 / Android-Room-Database-Backup

Simple tool to backup and restore your room database in Android
MIT License
239 stars 19 forks source link

Backward compatibility for API <26 #2

Closed kamal-lab closed 3 years ago

kamal-lab commented 3 years ago

This library requires min API 26. It will be good if we get support for at least until API 21

rafi0101 commented 3 years ago

@kamal-lab may you have a look at feature/api21, test it with your application and give me some feedback, so I can merge it. I tested it already but only with an emulator.

kamal-lab commented 3 years ago

Thanks for the update. I didn't use your library because at the time I was supposed to implement backup feature immediately. So I understood your concept and made a java helper class(since I'm not good with kotlin yet).

I used like this, File backupFile = ... File dbFile =... FileChannel source = new FileInputStream(dbFile).getChannel(); FileChannel dest = new FileOutputStream(backupFile).getChannel(); dest.transferFrom(source, 0, source.size());

And I checked that feature/api21 which is also working fine with minSdkVersion 21 and I tested it on API 28 device. But I don't have API 21 device with me currently if it is necessary for you to confirm.

rafi0101 commented 3 years ago

Thanks for your feedback. With the next release, this changes will be applied