Skip to content

Instantly share code, notes, and snippets.

@FireZenk
Last active December 4, 2017 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FireZenk/821d887c51e06333d885e41a5a15410d to your computer and use it in GitHub Desktop.
Save FireZenk/821d887c51e06333d885e41a5a15410d to your computer and use it in GitHub Desktop.
fun availableMemorySize(): Long {
val path: File = Environment.getDataDirectory()
val stat: StatFs = StatFs(path.getPath())
return stat.getAvailableBlocksLong() * stat.getBlockSizeLong()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment