As a follow on to:
https://www.b4x.com/android/forum/t...-erels-addbitmaptogallery.131374/#post-827725
which gives ability to put jpg/mp4 content in the Gallery in SDK 29+ devices...
I am looking for a way to be able to check if a user has subsequently deleted or moved the content in the Gallery on such 29+ devices and came up with this real simple possibility:
I am concerned that this may not be a robust solution - taking the stub of rp.GetSafeDirDefaultExternal("") and using it to construct the full path to the content to be checked.
Will it hold good on devices other than my Pixel 3?
What about future Android releases?
Is there a more robust way to do it?
Attached is the zipped project.
Thanks for all and any feedback...
https://www.b4x.com/android/forum/t...-erels-addbitmaptogallery.131374/#post-827725
which gives ability to put jpg/mp4 content in the Gallery in SDK 29+ devices...
I am looking for a way to be able to check if a user has subsequently deleted or moved the content in the Gallery on such 29+ devices and came up with this real simple possibility:
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
' Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
End Sub
Sub Activity_Create(FirstTime As Boolean)
CheckGallery("XYZalbum", "junk.jpg")
End Sub
Sub CheckGallery (AlbumName As String, TargetName As String)
Dim rp As RuntimePermissions
Dim root As String = rp.GetSafeDirDefaultExternal("")
Log(root)
root = root.SubString2(0, root.IndexOf("Android"))
Log(root & "Pictures/" & AlbumName)
Log(File.Exists(root & "Pictures/" & AlbumName, TargetName))
End Sub
I am concerned that this may not be a robust solution - taking the stub of rp.GetSafeDirDefaultExternal("") and using it to construct the full path to the content to be checked.
Will it hold good on devices other than my Pixel 3?
What about future Android releases?
Is there a more robust way to do it?
Attached is the zipped project.
Thanks for all and any feedback...