B4J Question [BANano]: [SOLVED] How to embed & read json file? / rather use BANanoSQL to load it?

Mashiane

Expert
Licensed User
Longtime User
Hi there

I'm not sure if this is possible or not even with other web stuff however I have something in mind.

I have json file that I need my app to read. Actually Im thinking of converting an sqlite db to json that my app will use in read only mode. I guess I can use sql.js without the need to convert the file, but anyway, let's assume I have a json file. Besides BANano has an sql engine so that will rather be not so on.

This off course will sit on the assets folder of the app. What could be the best approach for this?

perhaps use <script type=application/json> of <... type=text/javascript> to refer to the file and it will be loaded?

The backend for BANano alaSQL has a method,

B4X:
ATTACH FILESTORAGE DATABASE one("./myFile.json");

That seems to be able to do something like this. It would be perfect actually, however I dont know how I can ever get this to work.

Thanks in advance.
 
Top