Android Question Gallery sdk < 29

MotoMusher

Active Member
Licensed User
Longtime User
Same code works successfully with DirRootExternal. Now I have 2 copies of the image on disk though. Without writing everything in parallel, is there a way to just stay consistent with GetSafeDirDefaultExternal?
 
Upvote 0

MotoMusher

Active Member
Licensed User
Longtime User
Yes. Both run fine, no errors, but safedir does not add to Gallery on SDK 28.

This works.
B4X:
MyFilePath = File.DirRootExternal & "/MyApp"

Dim out As OutputStream = File.OpenOutput(MyFilePath, "MyDir/" & TargetName, False)
        File.Copy2(In, out)
        out.Close
        Dim FilePath As String = File.Combine(MyFilePath, "MyDir/" & TargetName)


This does not (file is there and same path for sdk 29+)
B4X:
MyFilePath = rp.GetSafeDirDefaultExternal("MyApp")

Dim out As OutputStream = File.OpenOutput(MyFilePath, "MyDir/" & TargetName, False)
        File.Copy2(In, out)
        out.Close
        Dim FilePath As String = File.Combine(MyFilePath, "MyDir/" & TargetName)
 
Upvote 0
Top