Android Question Embedding .gif into WebView and use of String Literals

Azhar

Active Member
Licensed User
Longtime User
B4X:
strCode(11) = "      <td width=" & Chr(34) & "17%" & Chr(34) & " align=" & Chr(34) & "left" & Chr(34) & " valign=" & Chr(34) & "top" & Chr(34) & "><img src=" & Chr(34) & WebViewAssetFile("floral2L.gif") & Chr(34) & " width=" & Chr(34) & "130" & Chr(34) & " height=" & Chr(34) & "126" & Chr(34) & "></td>"

Dear All,

I'm not too good with HTML and I need the 'floral2L.gif' file embedded into the HTML web page so that when I launch it from a web browser, I don't just see it's placement holder.

I was looking at String Literals but I'm not sure how to do it in the above code line.

Can anyone help or is there another way?

Kind regards,

Azhar
 

DonManfred

Expert
Licensed User
Longtime User
Something like... (hope did not forget anything)
B4X:
strCode(11) = $"      <td width="${"17%"}" align="left" valign="top"><img src="${WebViewAssetFile("floral2L.gif")}" width="130" height="126"></td>"$
 
Upvote 0

Azhar

Active Member
Licensed User
Longtime User
Something like... (hope did not forget anything)
B4X:
strCode(11) = $"      <td width="${"17%"}" align="left" valign="top"><img src="${WebViewAssetFile("floral2L.gif")}" width="130" height="126"></td>"$

Thanks very much for that. It makes a huge difference in the code line length and readability.
There was only one more problem... I have an LG G6 and I can't get it to install to the external SD Card even though the Project Attributes is set to: #CanInstallToExternalStorage: True. My LG G4 was the same also.
I read somewhere that you can't embed when items are stored within the internal Dir Assets... Hmm, I'll have to work on that.

But thanks again for this amendment of the generated HTML line. I think I'll do this for all 200 lines of the HTML!

Kind regards,

Azhar
 
Upvote 0
Top