Android Question [Solved] What is library of csbuilder in B4J and B4i

Theera

Well-Known Member
Licensed User
Longtime User
Hi all,
I 'm creating B4XThaiUtils B4XLib file ,I don't know what is library of csbuilder in B4J and B4i.
Please advise for me.

Best Regards,
Theera
 

Alexander Stolte

Expert
Licensed User
Longtime User
"java.lang.RuntimeException: SetDataFolder must be called before using this method."
1694588541820.png
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
And that prevents you from just trying things out?
View attachment 145803
Everything is explained.
B4X:
xui.SetDataFolder("YourAppName")
Post it in Sub initialize in bas file, YourAppName is B4XThaiUtils.bas) ,or
Post it in Sub initialize in B4XMainPage,YourAppName is TestThaiUtils

I'm not good at English,so I may refer to mistake something,Sir.
 
Last edited:
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
"java.lang.RuntimeException: SetDataFolder must be called before using this method."
View attachment 145800
I create the Defaultfolder at Roaming,then I have directory path c:\users\salea\Appdata\Roaming\DefaultFolder
And then I code in B4XMainPage at initialize
B4X:
 #If B4J
xui.setdatafolder("c:\users\salea\Appdata\Roaming\DefaultFolder ")
#End If
It's not correct. Could you make the complete the project for me studying? I think I can learn it.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Could you make the complete the project for me studying?
No! Then you won't learn it either. I even gave you a code snippet, you just had to change "YourAppName" with a name of your choice.
#If B4J is not needed, because the code does nothing in B4A and B4I as described.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
No! Then you won't learn it either. I even gave you a code snippet, you just had to change "YourAppName" with a name of your choice.
#If B4J is not needed, because the code does nothing in B4A and B4I as described.
I create project name is "TestThaiUtils" as B4XPages
So then I must code in initialize at B4XMAINPAGE
B4X:
 Xui.setdatafolder("TestThaiUtils")

I do understand is correct,or not?
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
I use B4XThaiUtils and B4XStringFunctionVB
How do I set setdatafolder ? I have edited both of them are
Xui.Defaultfolder
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Why not it can't remember itself? Make easy to code.
Because this is a global folder in the app data? I don't want another class or program that was also developed with B4J to write to the same app data folder. That's why you specify a name.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Because this is a global folder in the app data? I don't want another class or program that was also developed with B4J to write to the same app data folder. That's why you specify a name.
I have error code undeclared variable 'setdatafolder'
How do I code it
Dim setdatafolder as....?
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
I have error code undeclared variable 'setdatafolder'
How do I code it
Dim setdatafolder as....?
You should watch some tutorials of erel and other members on YouTube because you ask really basic questions and without minimal understanding it will be very difficult for you
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
You should watch some tutorials of erel and other members on YouTube because you ask really basic questions and without minimal understanding it will be very difficult for you
I can't listen to English. I can only write and read a little.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
B4XStringFunctionVB and B4XThaiUtils are important for Thai delvelopers. I would like to make accomplish. Thai people is rather the last group who understand English.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Dim setdatafolder as....?
No idea what you want with "Dim" now. But here is the code you need.
B4X:
Public Sub Initialize
    DataFileName = "Data_Temporary_File.map"
    xui.SetDataFolder("YourAppName")
    'DataPathName = File.DirInternal
    DataPathName = xui.DefaultFolder
End Sub
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
I will do tomorrow, because I must prepare the food for the children.And he or he use my phone for the game. Thank you for today.Thank you for the kind of you.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Hi Alexander,
After I coded at post #56 in Initailize,Why it still have error "setdatafolder must be called before using this method" I'm not sure that I set "YourAppName" correct ,or not? (Attached picture) I don't know where is my mistake. Please help me again.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
After I coded at post #56 in Initailize,Why it still have error "setdatafolder must be called before using this method" I'm not sure that I set "YourAppName" correct ,or not? (Attached picture) I don't know where is my mistake. Please help me again.
works by me.

Maybe you should provide an example project which shows the error.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
works by me.

Maybe you should provide an example project which shows the error.
Could mind send me to compare the code?
I don't know what something be wrong?
 
Upvote 0
Top