Here is my requirement. I need to unzip a zip file and store it in sdcard. I have now unzipped the file and stored in the sdcard by making use of the example provided here.And its working fine. Now before saving the file to sdcard I need to find out whether there is available space in sdcard so that I can extract my zip file without any problem. I found out this example helpful in finding out the size of a folder in sdcard. So I used this to find out the size of the unzipped files.
But here is my problem. As we know , when extracting a zip, we might need a little extra space to save the files, since unzipped file will not be of the same size as the zip file itself and it will require more space. Here goes my questions.
- How to find the available space in SDCard?
- Is there any way to identify the total space that would be required by the unzipped files even before unzipping it, so that i can inform the user if the available space in SD Card is not enough?
Any help is much appreciated.