Android Question Free Space on DirRootExternal

Arf

Well-Known Member
Licensed User
Longtime User
Hi,
Is there any way I can determine how much space is available in DirRootExternal?
I'd like to check that there is a minimum before creating my SQL DB file, on first program launch.
Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Log($"$1.3{GetFreeSpace / 1024 / 1024 / 1024} GB"$)   
End Sub

Sub GetFreeSpace As Long
   Dim jo As JavaObject
   jo.InitializeNewInstance("java.io.File", Array(File.DirRootExternal))
   Return jo.RunMethod("getFreeSpace", Null)
End Sub
 
Upvote 0
Top