android - pre-allocate space for a file before downloading it
- by android developer
how can i create a pre-allocated file on android? something like a sparse file ?
i need to make an applicaton that will download a large file , and i want to avoid having an out-of-space error while the download is commencing . my solution needs to support resuming and writing to both internal and external storage.
i've tried what is written here:
Create file with given size in Java
but none of the solutions there didn't work for some reason.