I am trying to specify default folder. Every option I tried tells me that it requires an array.
Please can you show me the correct format.
Thank you
B4X:
Dim appname As String ="ledposter-player"
xui.SetDataFolder(appname)
xui.DefaultFolder(appname)
'tried
'xui.DefaultFolder("C:\Users\peter\AppData\Roaming\ledposter-player")
'xui.DefaultFolder(array as string("C:\Users\peter\AppData\Roaming\ledposter-player"))
'xui.DefaultFolder(array("C:\Users\peter\AppData\Roaming\ledposter-player"))
' then
' dim appname() as string
' appname(0) = "ledposter-player"
' xui.DefaultFolder(appname(0))
' xui.DefaultFolder(File.DirData("ledposter-player"))
' xui.DefaultFolder((Array As String ("ledposter-player"))
' xui.DefaultFolder(File.DirData(Array As String ="ledposter-player"))
Ok, so I ran a very simple app through the B4J bridge. Put in this code
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
xui.SetDataFolder("ttrp")
End Sub
Sub Button1_Click
xui.MsgboxAsync(xui.DefaultFolder, "B4X")
Log(xui.DefaultFolder)
End Sub
and I got this folder on the Pi5. Is it a temp folder because I am using the remote bridge ?
or will all apps run on the Pi5 use the same folder ?
In rpi (Linux) production, you have to put your app at the path where the user has permissions.
Maybe /home/pi/MyApp, /opt/MyApp or /etc/MyApp
However, I prefer to put any documents, sqlite or app generated files in the same path of the jar using
B4X:
File.DirApp
Once you have build a standalone package, you can put your app to any path you like as long as permission is granted.
You can also let the app reads the path from a config file.
In rpi (Linux) production, you have to put your app at the path where the user has permissions.
Maybe /home/pi/MyApp, /opt/MyApp or /etc/MyApp
However, I prefer to put any documents, sqlite or app generated files in the same path of the jar using
B4X:
File.DirApp
Once you have build a standalone package, you can put your app to any path you like as long as permission is granted.
You can also let the app reads the path from a config file.
In rpi (Linux) production, you have to put your app at the path where the user has permissions.
Maybe /home/pi/MyApp, /opt/MyApp or /etc/MyApp
However, I prefer to put any documents, sqlite or app generated files in the same path of the jar using
B4X:
File.DirApp
Once you have build a standalone package, you can put your app to any path you like as long as permission is granted.
You can also let the app reads the path from a config file.
I took the .jar file and ran it on the Pi to see what path it gave me after specifying the app name , I expected a path with the app name inside but it showed me the path or where I have the .jar file
I then presume on the Pi OS it does not matter what I specify as the XUI.SetDataFolder is, It will always use the folder where the .jar is ? and windows will put it under APPDATA/ .... and the Appname
I took the .jar file and ran it on the Pi to see what path it gave me after specifying the app name , I expected a path with the app name inside but it showed me the path or where I have the .jar file
I then presume on the Pi OS it does not matter what I specify as the XUI.SetDataFolder is, It will always use the folder where the .jar is ? and windows will put it under APPDATA/ .... and the Appname