Android Question How to Save WebView data as .html file

JNG

Member
Licensed User
Hi!

I wanted to share a file with file provider library. I have created HTML string and loaded in webview by

WebView1.LoadHtml(ExecuteHtml(Reports.sbheader,Reports.sbdata,Reports.caption,False,1))

now I wanted to save it as .htm or .HTML to share with fileprovider. how I can create .html or .htm file.
I can capture image and share but instead of image as wanted to share as .html or .htm file.

regards
jng
 

ronell

Well-Known Member
Licensed User
Longtime User
you want to save your html file in your phone storage?
B4X:
File.Copy(File.DirAssets,"sample.html",File.DirRootExternal,"savedhtml.html")
 
Upvote 0

Smee

Well-Known Member
Licensed User
Longtime User
I have a similar problem. I am creating an HTML Table using dbutils and the following code


h = DBUtils.ExecuteHtml(Main.dbSQL, Query , Null, 500, False)
WebView1.LoadHtml(h)

The table shows fine on the screen even though it is too wide. What I want to do is to save the table and upload it to the internet. I know I can save with webview.CaptureBitmap but where is the image saved to for uploading?

Cheers

SOLVED

Thanks I was able to find the info I needed here
https://www.b4x.com/android/forum/threads/webview-capturebitmap.12779/
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…