Mikelgiles Active Member Licensed User Longtime User Mar 17, 2017 #1 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?
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 Expert Licensed User Longtime User Mar 17, 2017 #2 My routine for saving files is: Code: Copy 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
My routine for saving files is: Code: Copy 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.
Erel B4X founder Staff member Licensed User Longtime User Mar 19, 2017 #3 Mikelgiles said: 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? Click to expand... Yes and yes. The best place for writable files is File.DirData: https://www.b4x.com/android/forum/threads/data-folder.56874/ If the user will need to open the files with another application then it is best to let the user choose the location with FileChooser. Upvote 0
Mikelgiles said: 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? Click to expand... Yes and yes. The best place for writable files is File.DirData: https://www.b4x.com/android/forum/threads/data-folder.56874/ If the user will need to open the files with another application then it is best to let the user choose the location with FileChooser.