B4J Question What is the best place to put user files?

Mikelgiles

Active Member
Licensed User
Longtime User
What is the best practice for where to put application files that will be maintained by the user application.
When developing I am just putting them on a sub under dirAPP so I always know where they are.

Does dirAPP end up returning the location where the executable was installed? And if so is that likely to be a problem when writting to files there?
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
My routine for saving files is:

B4X:
    Dim Home As String = GetSystemProperty("user.home","")
    If GetSystemProperty("os.name","").ToLowerCase.Contains("win") Then
        Home = Home &"\Documentos"
    End If

    If Not(File.Exists(Home,"pdf")) Then
        File.MakeDir(Home,"pdf")
    End If

DirAPP is good enough too, but sometimes if you put the app in a wrong place (i.e. program files) you may have some troubles writing the folder.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…