Android - how to handle saving file on low device memory(Internal/External memory) -


how can handle file saving on low device memory(internal/excternal memrory). know if sufficient space not available os throw ioexception there way handle gracefully.

file path = environment.getdatadirectory(); statfs stat = new statfs(path.getpath()); long blocksize = stat.getblocksize(); long availableblocks = stat.getavailableblocks(); return formatter.formatfilesize(this, availableblocks * blocksize); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -