Update/write file in assets folder

Hello koders,
I have an application created with webview and it is currently on playstore.
The Problem
My problem is that each time I need to make correction in the html file, even just a single line, I have to re-upload the html file in kodular creator, export a new apk and go through the google play store approval process.
Possible Solution
I have two possible solutions however I’ve tried implementing them in vain.

  1. Find a method to write the html file in assets folder from my server.
    I have tried using the file component but it cannot write files that are in assets folder.

  2. Load HTML block in webview. This has proved to be the perfect solution, I tested it and it works fine with small codes and I even managed to update the html code from my server.
    However, the original html file for my project has 35,000 lines on code, and it doesn’t work. The apk cannot even be exported.
    I tired with the second file having 4,500 lines of code, the apk is being exported but gives a runtime error.

So I think load html cannot work with large codes. Again I cannot write files in assets folder with the knowledge I have.

Is there a solution to my problem? The main thing I want is to be able to update either the html file over the internet or use load html so that I can update the codes over the internet.

Thank you all.

What type of html file you are loading?
Means is there any credentials details like any bank details or transaction APIs…

1 Like

I am using Onsen UI Framework. The app has no transaction API. The user interface is pure HTML, CSS and Javascript with Jquery and bootstrap framework.
All the information plus the codes make the file have several lines of codes.
Now when I load the file using go to url, it works fine, but when I transfer the codes to load as html it doesn’t work however when tested with fewer lines of codes it works.

noone will be able to do this because after building the app the assets are read only
Taifun

1 Like

Now that I can’t update the files in assets, it means loadHTML is the only solution, but I don’t understand why it doesn’t work with large codes.
Attached is my home.html file (changed to .txt because .html could not upload) that I wanted to load its codes via LoadHTML, by storing the codes in TinyDB.
I may not not visually appeal because it depends on alot of other files which I won’t attach. Just use the codes to try it via loadHTML and tell me what might be the challenge and how to go about it.home.txt (427.5 KB)

You read @Taifun Post ?
You can store files on server and refences all files into your html code

1 Like

This is a good idea, but my app will cease having offline capabilities.
It seems I’ll have to stick to my old method of updating the app.
But could someone tell me why loadHTML cannot work with long/large codes?

Thanks some times my brain is online !!! ( not always ) :joy:
You do some test like set enable/disable java script, Desktop mode or others web viewer properties to found the right configurations ?

1 Like