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 for some reason, none of those solutions worked.
this is odd. it works fine now . perhaps i've tested it in a wrong way.
here's a working code , for those who have problems with it :