protected static Long getTotalInternalStorage ( ) { try { File path = Environment . getDataDirectory ( ) ; StatFs stat = new StatFs ( path . getPath ( ) ) ; long blockSize = stat . getBlockSize ( ) ; long totalBlocks = stat . getBlockCount ( ) ; return totalBlocks * blockSize ; } catch ( Exception e ) { Log . e ( TAG , "Error getting total internal storage amount." , e ) ; return null ; } }
Get the total amount of internal storage in bytes .