Android Question How get extsdcard free space ?

Upvote 0
Thanks DonManfred, works fine, but this give the total folder size, and to know the % of free space, i need to get the total size of the ext sdcard.
An other idea ?

Thanks.
 
Upvote 0
you can try the OSLibrary:
Code: Copy
Sub Activity_Create(FirstTime As Boolean)
Dim os As OperatingSystem
Dim percentAvailable As Double

percentAvailable = 100-((os.getBlockCount(File.DirDefaultExternal) - os.getFreeBlocks(File.DirDefaultExternal))/os.getBlockCount(File.DirDefaultExternal)) * 100
Log("percentAvailable " & percentAvailable)

End Sub
 
Upvote 0
Excellent !

Replacing "File.DirDefaultExternal" with the folder of the ext sdcard and it works perfectly !

Many thanks eurojam.
 
Upvote 0
Back
Top