MotoMusher Active Member Licensed User Longtime User Feb 4, 2021 #1 This question is specific to the following thread. It's not working for me, at least in the sdk 28 emulator. 29+ works fine for me. Add image to Gallery Android 5 - 10+ | B4X Programming Forum Is there a limitation to utilizing GetSafeDirDefaultExternal with the above code on < 29? That's my default location for images 29+ and I can't get these images in the gallery on older devices.
This question is specific to the following thread. It's not working for me, at least in the sdk 28 emulator. 29+ works fine for me. Add image to Gallery Android 5 - 10+ | B4X Programming Forum Is there a limitation to utilizing GetSafeDirDefaultExternal with the above code on < 29? That's my default location for images 29+ and I can't get these images in the gallery on older devices.
MotoMusher Active Member Licensed User Longtime User Feb 4, 2021 #2 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
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?
Erel B4X founder Staff member Licensed User Longtime User Feb 4, 2021 #3 MotoMusher said: This question is specific to the following thread. It's not working for me, at least in the sdk 28 emulator. 29+ works fine for me. Click to expand... Are you running the code as-is? What happens when you run it? Upvote 0
MotoMusher said: This question is specific to the following thread. It's not working for me, at least in the sdk 28 emulator. 29+ works fine for me. Click to expand... Are you running the code as-is? What happens when you run it?
MotoMusher Active Member Licensed User Longtime User Feb 4, 2021 #4 Yes. Both run fine, no errors, but safedir does not add to Gallery on SDK 28. This works. B4X: Copy 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: Copy 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
Yes. Both run fine, no errors, but safedir does not add to Gallery on SDK 28. This works. B4X: Copy 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: Copy 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)
Erel B4X founder Staff member Licensed User Longtime User Feb 5, 2021 #5 You need to use the exact code I posted. This is the safest implementation as the gallery can ignore other folders. Upvote 0
You need to use the exact code I posted. This is the safest implementation as the gallery can ignore other folders.
MotoMusher Active Member Licensed User Longtime User Feb 5, 2021 #6 Thank you. That was my question if there was a folder limitation of some type. I appreciate your input. Upvote 0
Thank you. That was my question if there was a folder limitation of some type. I appreciate your input.