Hi.
Until some time ago everithing worked fine.
In webview i load a Index.html with the path
file:///mnt/sdcard/AppInventor/assets/
but now when testing with companion give the error net::ERR_FILE_NOT_FOUND
When in production the path
file:///android_asset/
Works fine.
Any idea?
Thanks.
Taifun
August 1, 2021, 4:49am
#2
Try the path http://localhost
Taifun
2 Likes
Hi.
No, net::ERR_OCNNECTION_REFUSED
Taifun
August 1, 2021, 10:01pm
#4
can you please show your blocks to avoid misunderstandings…
Taifun
Taifun
August 1, 2021, 11:11pm
#6
you did not follow the suggestion…
in your case
http://localhost/index.html
Taifun
Go through the link below. It might help you.
I have kept a html file at application specific directory and when loading it to webviewer it thows an error;
[image]
This error is shown on android 11 devices but is working well on android 10.
I’m using default Kodular WebVeiwer component.
How can it be solved?
jose_coimbras:
In webview i load a Index.html with the path
file:///mnt/sdcard/AppInventor/assets/
but now when testing with companion give the error net::ERR_FILE_NOT_FOUND
When in production the path
file:///android_asset/
Works fine.
WebViewer
→ Path to the assets on all Android versions (Companion & APK):
2 Likes
pavi2410
(Pavitra Golchha)
August 2, 2021, 8:46am
#9
This is not implemented as of yet in Kodular. It’s on my radar
3 Likes
not working. I have in my phone android10.
Hi.
Where is the block call get ASD1.appspecificdirectory??
And sdk version? just can find android version.
thanks
Here is a small extension to get the ASD (path of app specific directory) which is becoming more and more important on Android 10+ and the private data dir (→ internal storage):
de.bodymindpower.GetASD.aix (6.3 KB)
[grafik]
The reason why I now added the privateDir will soon become clear when I show you how to store any kind of files in → internal storage (and not just text files like the File component does).
I think this is a milestone (at least for me):
I am very happy that this is (no…
But you can also use this:
Hi, thanks for reply.
So, there is no inmediate solution without install an extension?
Well install an extension just for test porposes … if there is no other way, i will try it.
By now, why the icon works if is an asset also?
Thanks.
system
(system)
Closed
September 2, 2021, 11:41pm
#15
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
Kevinkun
(kevinkun)
August 2, 2021, 8:28am
#16
Now the file name/path is so chaos and confusing,
In File component, the path is like this:
aa.txt for private dir, //aa.txt for assets, /aa.txt for from sdcard,
(May be we can add a ‘#/aa.txt’ for ASD later)
This is good for users, but for Web component:
(photo taken from Anke’s post )
Why the user have to check if it’s in companion or sdkVersion? all theses checking should be done inside the component. and the user only need to give the url a string like “//index.html ” for loading html from asset.
Kodular staff, please make the Web (and other components need to read/write) using the same phylosophy with File component.
This suggestion is also for the extension developers.
2 Likes
pavi2410
(Pavitra Golchha)
September 3, 2021, 7:28am
#17
This change will land with the next update when available
mit-cml:ucr
← ewpatton:feature/universal-webview-paths
opened 10:39PM - 05 Aug 20 UTC
Currently, app developers need to specify different URLs based on whether the We… bViewer runs in the companion or in a compiled app if they intend to reference app assets. This is further complicated by the fact that in newer versions of Android we will need to use app-specific directories, and while this seems to be consistent there isn't a guarantee that it will be, so now app developers may have to juggle 3 paths.
With this change, the asset test.html can be referenced as `http://localhost/test.html` and it will resolve correctly both in the companion and the compiled app--no futzing with special paths required [*].
[*] Well, technically this only works on Honeycomb and higher, but that's a fairly safe assumption at this point and the old approach still works if people really need that level of backward compatibility (e.g., the old emulator).
Change-Id: I3c429aeae6f4ced89dfd07f75ddaa92e277ed019
You can now use http://localhost/
prefix to access any file in assets on both compiled app and companion.
4 Likes