Linking local image in webview

Brad

Active Member
Licensed User
Longtime User
I'm loading a local html file into a webview. The html code is linking images that are also stored in the asset dir. I have tried several variations with no luck. I'm sure that I'm missing something easy but it seems to be escaping me tonight. :sign0163:
 

Brad

Active Member
Licensed User
Longtime User
Thanks Erel. :sign0098: Of course it was in the manual :sign0161:..Gotta stop coding late at night.
 
Upvote 0

aklisiewicz

Active Member
Licensed User
Longtime User
I'm still unclear about the images. Say I have MyImage01.jpg added to the assets folder how can I sue LoadURL() method and have that image referenced in the HTML code ?

or I can only use LoadHYML()?

I have an activity which supposed to display an HTML file. It works but when I added an image to the HTML file and I added the file to the FILES tab the App displays only an image placeholder with the name (no image). any ideas ?

Arthur
 
Upvote 0

aklisiewicz

Active Member
Licensed User
Longtime User
that's what I needed - thank a lot!
one more thing: dos this path refer for the emulator / device or both ?

what wold be recommended method to download images from FTP or WEB server and store them in that folder, so they can be later referenced in WebView ?

Arthur
 
Upvote 0

RjCl

Member
Licensed User
Longtime User
To load a local picture you need to do this in your HTML:
B4X:
<img src='file:///android_asset/mypicture.jpg'/>

Is that the same for all local linked files? .js .css files etc ? im using html file that uses local image and i had in the normal html way <img src='picture.jpg'/> and it still showed ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…