Android Question Photo default folder

Rusty

Well-Known Member
Licensed User
Longtime User
How can one find the default photo folder set up by the user.
i.e. "file.dirrootexternal"/DCIM/Camera
Sometimes people set up their own folder or the SDCard vs internal storage.
I'd like to get the name/location of the folder where the default camera stores photos.
Thanks,
Rusty
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Log(GetExternalStoragePublicDirectory("DCIM"))
End Sub

Sub GetExternalStoragePublicDirectory (name As String) As String
   Dim jo As JavaObject
   jo.InitializeStatic("android.os.Environment")
   Dim path As Object = jo.RunMethod("getExternalStoragePublicDirectory", Array(name))
   If path = Null Or File.Exists(path, "") = False Then
     Log("No such folder.")
     Return ""
   End If
   Return path
End Sub
 
Upvote 0
Top