Android Question Is it possible to write and read a file from RAM memory ?


Licensed User
Hello! Now I take a picture, write it to a SD card and then read it and send it to FTP server. I think the SD card might get damaged. Is it possible to write a snapshot to a temporary file in RAM memory and then read from there. If so, how?

My code now:
If File.Exists(File.DirRootExternal, "face0.jpg") Then
File.Delete(File.DirRootExternal, "face0.jpg")
End If
out = File.OpenOutput(File.DirRootExternal, "face0.jpg", False)
out.WriteBytes(jpeg, 0, jpeg.Length)
ToastMessageShow("Image saved: " & File.Combine(File.DirRootExternal, "face0.jpg"), True)

ftp1.UseSSL = False
ftp1.PassiveMode = True


Licensed User
Upvote 0

Brian Dean

Active Member
Licensed User
File.DirInternal this is RAM (random access memory)?
Not sure what you are really asking. Yes - it is random access memory. It is the storage area to which only the app has access, unlike File.DirExternal which is accessible to other apps (and shows up in file manager apps). Can't find a link on the forum that explains the different memory regions - maybe someone else can.

EDIT : Here is one of the more useful explanations of file and memory regions.
Last edited:
Upvote 0