Passing an observable to a WebView

How can I pass an observable to a WebView and ultimately use it in my local HTML file?

Hi onnytau,

could you please explain what are you trying to do, and show some code to explain what you’ve tried so far?

Hey Uldis

I am trying to generate a QR code using HTML 5 canvas (inside WebView) but do not want to fetch the data via a URL since the QR code will be generated while the device is offline. Therefore since the data will be from the Storage API, I need a way to inject it into an HTML source before the source is rendered in the WebView.

I haven’t written any code for it as of now, I am still designing a way to achieve what was just explained above.

If there is a better solution than what I envision please feel free to suggest.

It seems you will need to get started and build at least something that you could then share. Also, please start with a higher-level description (like a use-case) of what you’re trying to build, because the offline-storage-generate-inject roundabout doesn’t make it any clear at this point.

Off the top of my head, it seems to me what you need to do is first generate a desired file path for your output image, store that, and then inject that into your webview to generate the image in that location. You need to predict this, not respond to it. Then you can, not ideally but realistically, periodically poll the path using FileSystem to check for the file’s existence and size.

Hello, I need to do qrcode offline too, have you had success in your application with qrcode? Let me know how you did it.