B4X:
Sub FindUserDocumentsFolder As String
If DetectOS = "windows" Then
Dim jo As JavaObject
Dim fs As JavaObject = jo.InitializeStatic("javax.swing.filechooser.FileSystemView").RunMethod("getFileSystemView", Null)
Return fs.RunMethodJO("getDefaultDirectory", Null).RunMethod("getPath", Null)
Else
Return GetSystemProperty("user.home", "") & "/Documents"
End If
End Sub
Sub DetectOS As String
Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
If os.Contains("win") Then
Return "windows"
Else If os.Contains("mac") Then
Return "mac"
Else
Return "linux"
End If
End Sub
Tested on Windows and Mac only.