That's what we've been getting before.
Before Android API18: Fs.getavailableblocks () *fs.getblocksize ()
Currently
/** gets the system available memory **/@SuppressLint ("Newapi") Private String Getmemfree () {StatFs fs = new StatFs (environment.getdatadirectory (). GetPath ()); return Formatter.formatfilesize (This, (Fs.getavailablebytes ()));} /** gets the SD available memory **/@SuppressLint ("Newapi") Private String Getsdfree () {if (Environment.getexternalstoragestate (). Equals ( environment.media_mounted)) {StatFs fs = new StatFs (Environment.getexternalstoragedirectory (). GetPath ());//android Before API18: Fs.getavailableblocks () *fs.getblocksize () return formatter.formatfilesize (This, (Fs.getavailablebytes ())) ;} Return "not Loaded";}
Finally solved the problem, quack.
Android latest Get phone built-in storage size, SD card storage space Size method