Zeev Goldstein Well-Known Member Licensed User Longtime User Jul 14, 2024 #1 hi i have 2 apps in both i use a piece of code that generates dynamic data required by both currently i use the same code in both so for each modification i need to copy and paste the code into both overwriting the existing code is there a way i can have an external file with the b4a code or even just a text code so then i can parse it to avoid copy & paste? what i mean is that i want to modify that text file and on runtime to use the content as the data i did try using a file on the server and download it but i think this way should be better is it? the online & download file has one big advantage as i can modify it without recompile and redistribute any views / opinions / suggestions? thanks
hi i have 2 apps in both i use a piece of code that generates dynamic data required by both currently i use the same code in both so for each modification i need to copy and paste the code into both overwriting the existing code is there a way i can have an external file with the b4a code or even just a text code so then i can parse it to avoid copy & paste? what i mean is that i want to modify that text file and on runtime to use the content as the data i did try using a file on the server and download it but i think this way should be better is it? the online & download file has one big advantage as i can modify it without recompile and redistribute any views / opinions / suggestions? thanks
DonManfred Expert Licensed User Longtime User Jul 14, 2024 #2 - You can NOT load B4A-Code at runtime. B4A-Code is compiled to java at COMPILEtime. - The code can not be compiled to java at runtime. Use a class to implement this functionality and add this class to both your apps. You have to update both app for sure when the class changed. Last edited: Jul 14, 2024 Upvote 0
- You can NOT load B4A-Code at runtime. B4A-Code is compiled to java at COMPILEtime. - The code can not be compiled to java at runtime. Use a class to implement this functionality and add this class to both your apps. You have to update both app for sure when the class changed.
Zeev Goldstein Well-Known Member Licensed User Longtime User Jul 14, 2024 #3 Thanks That's exactly what i do now So i need to recompile on every chane both apps I think the text file with updated data on the server to be downloaded and parsed will be the best as i will be able to update the date dynamically without recompile and re distribute Upvote 0
Thanks That's exactly what i do now So i need to recompile on every chane both apps I think the text file with updated data on the server to be downloaded and parsed will be the best as i will be able to update the date dynamically without recompile and re distribute
DonManfred Expert Licensed User Longtime User Jul 14, 2024 #4 It is up to you to store a updated datafile (NO Code!) on your server and download the file. Upvote 0
aeric Expert Licensed User Longtime User Jul 14, 2024 #5 Not sure I understand what you are trying to do. If both app wants to use a common class or module, you can create a b4x library and both projects load the same library. Upvote 0
Not sure I understand what you are trying to do. If both app wants to use a common class or module, you can create a b4x library and both projects load the same library.
Zeev Goldstein Well-Known Member Licensed User Longtime User Jul 14, 2024 #6 aeric said: Not sure I understand what you are trying to do. If both app wants to use a common class or module, you can create a b4x library and both projects load the same library. Click to expand... Either library / class / module is what i do now so on every change i need to recompile and distribute again I wanted tondo it dynamically So i change the code in a text file that the app will download and use This way no need to recompile and distribute on every change Seems it's impossible so I'll stick to the current approach Thank you all Upvote 0
aeric said: Not sure I understand what you are trying to do. If both app wants to use a common class or module, you can create a b4x library and both projects load the same library. Click to expand... Either library / class / module is what i do now so on every change i need to recompile and distribute again I wanted tondo it dynamically So i change the code in a text file that the app will download and use This way no need to recompile and distribute on every change Seems it's impossible so I'll stick to the current approach Thank you all
aeric Expert Licensed User Longtime User Jul 14, 2024 #7 If the content or data change frequently, the best is to use database. Upvote 0
LucaMs Expert Licensed User Longtime User Jul 14, 2024 #8 aeric said: If the content or data change frequently, the best is to use database. Click to expand... In case of data, it is obviously the best and obvious solution; but what about processing? If the logic is minimal, you could try to enter "instructions" (keywords) into the DB in order to drive the execution (flow) of the apps. Upvote 0
aeric said: If the content or data change frequently, the best is to use database. Click to expand... In case of data, it is obviously the best and obvious solution; but what about processing? If the logic is minimal, you could try to enter "instructions" (keywords) into the DB in order to drive the execution (flow) of the apps.
Daestrum Expert Licensed User Longtime User Jul 14, 2024 #9 You could look at URLClassLoader if you want to load a class at runtime. Be aware this a security problem though, and would require quite a bit of 'new' code in your app to work. Upvote 0
You could look at URLClassLoader if you want to load a class at runtime. Be aware this a security problem though, and would require quite a bit of 'new' code in your app to work.
E emexes Expert Licensed User Longtime User Jul 14, 2024 #10 Zeev Goldstein said: Seems it's impossible Click to expand... or maybe not - can you give some examples of the output of: Zeev Goldstein said: generates dynamic data Click to expand... It might be a task that can be done with a "little language" interpreter. Upvote 0
Zeev Goldstein said: Seems it's impossible Click to expand... or maybe not - can you give some examples of the output of: Zeev Goldstein said: generates dynamic data Click to expand... It might be a task that can be done with a "little language" interpreter.
Zeev Goldstein Well-Known Member Licensed User Longtime User Jul 15, 2024 #11 guys, thank you all for your good will i will keep on using the same way i do now as i anyhow have to update the app in the store from time to time as google demands sdk targeting etc so the existing way is the only solution for me once again thank you all Upvote 0
guys, thank you all for your good will i will keep on using the same way i do now as i anyhow have to update the app in the store from time to time as google demands sdk targeting etc so the existing way is the only solution for me once again thank you all